import { ReactNode } from 'react'; import { HiOutlineX } from 'react-icons/hi'; import { Flex } from '../Flex'; import { Heading } from '../Heading'; import { IconButton } from '../IconButton'; import { Container, Size } from './styles'; type DrawerProps = { children: ReactNode; open: boolean; onOpenChange: (state: boolean) => void; title: string; size?: Size; }; export function Drawer({ children, open, onOpenChange, title, size = 'sm', }: DrawerProps): JSX.Element { function handleClose(): void { onOpenChange(false); } if (!open) { return <>; } return ( {title} } onClick={handleClose} /> {children} ); }