import { Popover, Transition } from '@headlessui/react' import { XMarkIcon } from '@heroicons/react/20/solid' import { useTheme } from 'next-themes' import { Fragment, ReactNode } from 'react' const IconDropMenu = ({ icon, children, disabled, size, postion = 'bottomRight', }: { icon: ReactNode children: ReactNode disabled?: boolean size?: 'small' | 'medium' | 'large' postion?: | 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topRight' | 'leftBottom' | 'leftTop' | 'rightBottom' | 'rightTop' }) => { const panelPosition = { bottomLeft: size === 'large' ? 'left-0 top-14' : 'left-0 top-12', bottomRight: size === 'large' ? 'right-0 top-14' : 'right-0 top-12', topLeft: size === 'large' ? 'left-0 bottom-14' : 'left-0 bottom-12', topRight: size === 'large' ? 'right-0 bottom-14' : 'right-0 bottom-12', leftBottom: size === 'large' ? 'right-14 bottom-0' : 'right-12 bottom-0', leftTop: size === 'large' ? 'right-14 top-0' : 'right-12 top-0', rightBottom: size === 'large' ? 'left-14 bottom-0' : 'left-12 bottom-0', rightTop: size === 'large' ? 'left-14 top-0' : 'left-12 top-0', } const { theme } = useTheme() return ( {({ open }) => (
{open ? : icon} {children}
)}
) } export default IconDropMenu