Delete customer dialog
Confirm deleting a customer. The API refuses while the customer has invoices or recurring schedules, and the notification says so.
Dialog: a modal you open from your own screen. You control when it opens with its props. Pages vs components
Ready to connect to Dolfin. Loads data through SDK hooks, with appearance and behaviour you can customise. Requires DolfinProvider.
Installation
Needs the Dolfin registry token. The CLI copies the source into your app.
bunx --bun shadcn@4.23.0 add @dolfin/ar-customer-delete-dialogAlso installs: alert-dialog, base-theme, ui-ar-customer-delete-dialog.
Usage
import { ArDeleteCustomerDialog } from "@/components/dolfin/ar/delete-customer-dialog";
// Place it anywhere inside your <DolfinProvider>.
<ArDeleteCustomerDialog customer={customer} onOpenChange={handleOpenChange} />Renders inside DolfinProvider (set it up once). By default it loads its own data through the SDK. Supplied-data examples show how to override that behavior.
API reference
| Prop | Type | Description |
|---|---|---|
customer required | Pick<{ id?: string; organisationId?: string; name: string; email?: null | string; phone?: null | string; taxNumber?: null | string; addressL… | The customer to delete; `null` keeps the dialog closed. |
onOpenChange required | (open: boolean) => void | |
onDeleted | (customerId: string) => void | After the customer was deleted; the dialog has closed. |
onConfirm | (customerId: string) => Promise<unknown> | void | Deletes the customer yourself instead of the SDK; the dialog closes once it settles. |
submitting | boolean | Your own delete is running. |
title | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | |
description | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | |
className | string |
Customisation
Without editing the source, you can change:
- Class names
className- Messages
ar.customers.remove
Or edit the installed file directly: it is your code. See theming for colours and fonts.
Hooks
The SDK hooks this dialog uses. Use them directly from @dolfinai/react to build your own version.
useCustomerMutationsuseMessagesFiles
Written to your app by the install command:
components/dolfin/ar/delete-customer-dialog.tsx74 lines