components/bits/ConfirmDialog#
ConfirmDialog()#
Generic confirmation dialog for destructive or irreversible actions.
Replaces window.confirm, which is out of keeping with the rest of the app and
can't carry an icon, a busy state, or translated copy.
Renders through StyledDialog so it inherits the app's dialog skin — the
blurred scrim, the bordered paper, the button treatment. It used to render a
raw MUI <Dialog> with its own borderRadius: 3 paper, which meant the app's
confirmation dialogs were the ones that looked least like the app.
browser/DeleteConfirmationDialog and LostForeverWarning are now thin
wrappers over this component rather than separate implementations.
Parameters#
| Parameter | Type |
|---|---|
props |
ConfirmDialogProps |
Returns#
Element
ConfirmDialogProps#
Properties#
busy?#
Keeps the dialog open with a spinner while the action is in flight.
cancelLabel?#
Defaults to the shared common:buttons.cancel label.
children?#
Extra content between the message and the actions (a checkbox, a list).
confirmLabel#
destructive?#
Renders the confirm action in error colors and tints the icon tile.
icon?#
Pass null to drop the icon tile entirely.
maxWidth?#
xs (the default) for a one-line question, sm when the copy is longer.
message#
onClose#
Returns#
void
onConfirm#
Returns#
void
open#
sx?#
Forwarded to the underlying dialog — layering, mostly.