import * as Dialog from "@radix-ui/react-dialog"; import type { ReactNode } from "react"; // Reusable modal shell — a thin wrapper over Radix Dialog matching the terminal // chrome (title bar + ✕, dark overlay, square panel). The same styling BoothPayModal // uses inline, factored out so every popped-out form looks identical. Radix handles // focus trap, Escape, and outside-click → onClose. `width` is a Tailwind max-width // class (the panel is responsive: w-full up to that cap). export function Modal({ open, onClose, title, children, width = "max-w-xl", }: { open: boolean; onClose: () => void; title: ReactNode; children: ReactNode; /** Tailwind max-width class for the panel (default max-w-xl). */ width?: string; }) { return ( !o && onClose()}>
{title} ✕
{children}
); }