import { h } from '/static/admin2/vendor/preact.module.js'; import { useEffect } from '/static/admin2/vendor/hooks.module.js'; import htm from '/static/admin2/vendor/htm.module.js'; const html = htm.bind(h); export const Drawer = ({ title, onClose, children }) => { useEffect(() => { const esc = (e) => { if (e.key === 'Escape') onClose(); }; document.addEventListener('keydown', esc); return () => document.removeEventListener('keydown', esc); }, [onClose]); return html`
`; };