dolfindevelopers

Delete tax rate dialog

DialogReceivablesSDK + UI

Confirm deleting a custom tax rate; a refusal from the API is reported through the notification.

Dialog: a modal you open from your own screen. You control when it opens with its props. Pages vs components

Choose your integration

Ready to connect to Dolfin. Loads data through SDK hooks, with appearance and behaviour you can customise. Requires DolfinProvider.

Loading preview…

Installation

Needs the Dolfin registry token. The CLI copies the source into your app.

Terminal
bunx --bun shadcn@4.23.0 add @dolfin/ar-tax-rate-delete-dialog

Also installs: alert-dialog, base-theme, ui-ar-tax-rate-delete-dialog.

Usage

screen.tsx
import { ArDeleteTaxRateDialog } from "@/components/dolfin/ar/delete-tax-rate-dialog";

// Place it anywhere inside your <DolfinProvider>.
<ArDeleteTaxRateDialog taxRate={taxRate} 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

PropTypeDescription
taxRate requiredPick<{ id?: string; organisationId?: null | string; code: string; name: string; rate?: number | string; source: string; isReadOnly?: boolean…The rate to delete; `null` keeps the dialog closed.
onOpenChange required(open: boolean) => void
onDeleted(taxRateId: string) => void
onConfirm(taxRateId: string) => Promise<unknown> | voidDeletes it yourself instead of the SDK; the dialog closes once it settles.
submittingbooleanYour own delete is running.
titlestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…
descriptionstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…
classNamestring

Customisation

Without editing the source, you can change:

Class names
className
Messages
ar.taxRates.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.

useMessagesuseTaxRateMutations

Files

Written to your app by the install command:

  • components/dolfin/ar/delete-tax-rate-dialog.tsx 70 lines