// The app's dialog window: an Ant Design modal around the dialog's own content (heading, fields, action row). import { Modal as AntModal } from "antd"; import type { HTMLAttributes, ReactNode } from "react"; interface Props extends Omit, "onClick"> { /** Escape and a click outside close the dialog; without it the dialog stays until its own buttons close it. */ onClose?: () => void; /** Extra classes of the content ("wide" makes the window wider). */ className?: string; children?: ReactNode; } export function Modal({ onClose, className = "", children, ...rest }: Props) { const wide = /\bwide\b/.test(className); return ( onClose?.()} destroyOnHidden >
{children}
); }