Design
llms.txt

Overlays

ConfirmDialogProvider

App-wide confirmations through one hook: wrap the app in ConfirmDialogProvider, then call useConfirm().confirm({...}) anywhere.

MaxOverlaysMarkdown
Open

Usage#

Options: title, description, confirmText (default "Confirm"), cancelText (default "Cancel"), variant (default | destructive), and onConfirm (may return a promise — the action shows a spinner until it settles, then the dialog closes).

Destructive treatment: a 48px round red tile with AlertTriangle, and a red action button.

Write it like this: a specific title with the object's name ("Disconnect claire@northwind.io?"), the consequence in the description ("Its 2 running campaigns pause until you connect another sender."), and verbs on both buttons ("Keep connected" / "Disconnect").

Facts#

ProductMax
FamilyOverlays
Globalwindow.DigitalCrew.ConfirmDialogProvider
Sourcemax-agent: src/components/shared/confirm-dialog.tsx
Import in the appimport { ConfirmDialogProvider } from "@/components/shared/confirm-dialog";

API#

TypeScript declarations emitted from src/components/shared/confirm-dialog.tsx.

export declare function ConfirmDialogProvider({ children }: {
    children: ReactNode;
}): JSX.Element;
export declare function useConfirm(): any;

Code#

The preview above, as plain React.createElement against window.DigitalCrew with realistic data. Copy it into a page that loads the bundle.

<div id="root" class="p-6"></div>
<script>
(function () {
  var h = React.createElement, DC = window.DigitalCrew, I = DC.Icons;
function Asker() {
  var confirm = DC.useConfirm().confirm;
  React.useEffect(function () {
    confirm({ title: "Disconnect claire@northwind.io?", description: "Its 2 running campaigns pause until you connect another sender.", confirmText: "Disconnect", cancelText: "Keep connected", variant: "destructive", onConfirm: function () {} });
  }, []);
  return h(DC.Button, { variant: "outline" }, "Disconnect mailbox");
}
function App() { return h(DC.ConfirmDialogProvider, null, h(Asker)); }
  ReactDOM.createRoot(document.getElementById("root")).render(h(DC.TooltipProvider, { delayDuration: 80 }, h(App)));
})();
</script>