export interface DialogAction { label: string; onClick: () => void; className?: string; disabled?: boolean; } interface Props { message: string; detail?: string; confirmLabel?: string; isDestructive?: boolean; /** Required unless `actions` is provided (which replaces the single confirm button). */ onConfirm?: () => void; onCancel: () => void; /** When provided, rendered after Cancel instead of the single confirm button. */ actions?: DialogAction[]; } export function ConfirmDialog({ message, detail, confirmLabel = "Confirm", isDestructive = false, onConfirm, onCancel, actions, }: Props) { return (
{ if (e.target === e.currentTarget) onCancel(); }} >

{message}

{detail &&

{detail}

} {!detail &&
}
{actions ? ( actions.map((a) => ( )) ) : ( )}
); }