SwitcherPopover.jsx 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. import { Grid } from '@/components/products/Grid'
  2. import { Popover, Transition } from '@headlessui/react'
  3. export function SwitcherPopover({ children, menuItem, ...props }) {
  4. return (
  5. <Popover {...props}>
  6. {children}
  7. {/* <Transition
  8. enter="transition ease-out duration-200"
  9. enterFrom="opacity-0 translate-y-1"
  10. enterTo="opacity-100 translate-y-0"
  11. leave="transition ease-in duration-150"
  12. leaveFrom="opacity-100 translate-y-0"
  13. leaveTo="opacity-0 translate-y-1"
  14. > */}
  15. <Popover.Panel className="absolute z-10 m-auto mt-4 ">
  16. {({ close }) => (
  17. <div className="fixed left-0 w-full">
  18. <div className="m-auto w-full max-w-[600px] overflow-hidden rounded-lg bg-white p-4 shadow-xl ring-1 ring-black ring-opacity-5 dark:border dark:border-slate-600 dark:bg-neutral-900">
  19. <Grid
  20. onClick={close}
  21. menuItem={menuItem}
  22. numCols={'grid-cols-2'}
  23. />
  24. </div>
  25. </div>
  26. )}
  27. </Popover.Panel>
  28. {/* </Transition> */}
  29. </Popover>
  30. )
  31. }