import type { PropsWithChildren, ReactNode } from 'react'; import { IconX } from './icons'; interface ModalProps { open: boolean; title?: ReactNode; onClose: () => void; footer?: ReactNode; width?: number | string; } export function Modal({ open, title, onClose, footer, width = 520, children }: PropsWithChildren) { if (!open) return null; const handleMaskClick = (event: React.MouseEvent) => { if (event.target === event.currentTarget) { onClose(); } }; return (
{title}
{children}
{footer &&
{footer}
}
); }