Buttons, fields, drop-downs, check boxes, tabs, dialogs and notices are Ant Design components; their tokens come from the theme variables (web/src/ui). Every factory board column has its own vertical scrollbar. ChatView rendered fewer hooks once its chat was deleted. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
// 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<HTMLAttributes<HTMLDivElement>, "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 (
|
|
<AntModal
|
|
open
|
|
centered
|
|
footer={null}
|
|
closable={false}
|
|
width={wide ? 960 : 560}
|
|
keyboard={!!onClose}
|
|
mask={{ closable: !!onClose }}
|
|
onCancel={() => onClose?.()}
|
|
destroyOnHidden
|
|
>
|
|
<div className={`modal ${className}`.trim()} {...rest}>
|
|
{children}
|
|
</div>
|
|
</AntModal>
|
|
);
|
|
}
|