import React, { useState } from "react" import { Center, Flex, Text } from "@chakra-ui/react" import { Icon } from "../Icon/Icon" export const SettingsMenu = (props) => { const [show, setShow] = useState(false) const showMenu = React.useCallback(() => { setShow(true) }, []) const hideMenu = React.useCallback(() => { setShow(false) }, []) const basePadding = React.useMemo(() => { return 4 }, []) const types = React.useMemo(() => { const ret = [ { label: "any", icon: "any" }, "object", "array", "string", "number", "boolean", ] return ret }, []) const onChangeType = React.useCallback( (type) => { props?.onChangeType?.(type) }, [props?.onChangeType] ) const onDelete = React.useCallback( (type) => { props?.onDelete?.() }, [props?.onDelete] ) const iconSize = 10 return (
{!props?.readonly && ( Types )} {!props?.readonly && types.map((type, idx) => { const ret = ( div": { background: "greys.light", }, }} onClick={() => onChangeType(type?.key || type)} paddingY={1} > {type?.label || type?.key || type} ) return ret })} {!props?.readonly && ( Recycle )}
) }