import React, { ReactNode, useEffect } from 'react'; export function ModalShell({ label, maxWidth, onClose, children, }: { label: string; maxWidth: number; onClose: () => void; children: ReactNode; }): JSX.Element { useEffect(() => { const onKey = (event: KeyboardEvent): void => { if (event.key === 'Escape') onClose(); }; document.addEventListener('keydown', onKey); return () => document.removeEventListener('keydown', onKey); }, [onClose]); return (
{ if (event.target === event.currentTarget) onClose(); }} style={{ animation: 'rcm-overlay .2s ease both' }} className="fixed inset-0 z-50 flex items-start justify-center px-5 py-[clamp(20px,7vh,72px)] overflow-y-auto bg-[rgba(32,34,35,0.45)] backdrop-blur-[4px]" >
{children}
); }