'use client' import { useEffect } from 'react' import { X } from 'lucide-react' interface DrawerProps { isOpen: boolean onClose: () => void title: string children: React.ReactNode } export default function Drawer({ isOpen, onClose, title, children }: DrawerProps) { // Close on Escape key useEffect(() => { const handleEsc = (e: KeyboardEvent) => { if (e.key === 'Escape') onClose() } if (isOpen) { document.addEventListener('keydown', handleEsc) document.body.style.overflow = 'hidden' } return () => { document.removeEventListener('keydown', handleEsc) document.body.style.overflow = '' } }, [isOpen, onClose]) if (!isOpen) return null return (