"use client"; import { Portal } from "@radix-ui/react-portal"; import clsx from "clsx"; import { usePreventScroll } from "react-aria"; import useMeasure from "react-use-measure"; interface Props { show: boolean; onDismiss?: () => void; } const Drawer: React.ComponentType> = ({ children, show, onDismiss, }) => { usePreventScroll({ isDisabled: !show }); // useMeasure will update through window resize const [ref2, bounds] = useMeasure(); return (
{ onDismiss?.(); }} />
{children}
); }; export default Drawer;