import { FunctionComponent, ReactNode } from 'react' import { Listbox } from '@headlessui/react' import Tooltip from './Tooltip' type DropMenuProps = { button: ReactNode buttonClassName?: string onChange: (...args: any[]) => any options: Array toolTipContent?: string value?: any } const DropMenu: FunctionComponent = ({ button, buttonClassName, value, onChange, options, toolTipContent, }) => { return (
{({ open }) => ( <> {toolTipContent && !open ? ( {button} ) : ( button )} {open ? ( {options.map((option) => ( {({ selected }) => (
{option.icon ? (
{option.icon}
) : null} {option.name}
)}
))}
) : null} )}
) } export default DropMenu