import { useEffect } from 'react' export default function Drawer({ isOpen, onClose, children }) { useEffect(() => { const h = (e) => { if (e.key === 'Escape') onClose() } if (isOpen) document.addEventListener('keydown', h) return () => document.removeEventListener('keydown', h) }, [isOpen, onClose]) return ( <> {isOpen && (
)}
{/* Handle bar + close */}
{/* Scrollable content — overflow-visible on x so badge doesn't clip */}
{children}
) }