dolfindevelopers

Policy document review

ComponentExpensesSDK + UI

Reviews an expense policy document once it is read: every proposed approval policy against the clause it came from (edit, leave out or include), the clauses that can't be enforced and why, the current policies confirming would delete, and a sticky Confirm policies bar with a confirmation listing what applies. Read-only without the manageExpensePolicies permission. Driven by useExpensePolicyDocumentReview.

Component: A piece you place inside your own screens: a table, a form, a card or a dialog. You decide the layout around it. 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/expenses-policy-document-review

Also installs: alert-dialog, badge, button, card, base-theme, base-page, expenses-policy-document-proposals, ui-expenses-policy-document-review.

Usage

screen.tsx
import { ExpensePolicyDocumentReview } from "@/components/dolfin/expenses/policy-document-review";

// Place it anywhere inside your <DolfinProvider>.
<ExpensePolicyDocumentReview document={document} />

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
document required{ id: string; version: number | string; fileName: string; contentType: string; sizeBytes?: number | string; pageCount?: null | number | stri…A document that has been read (ready for review, confirmed or superseded).
referenceDataExpensePolicyReferenceDataNames for the proposals' categories, merchants and approvers; read here when not passed.
onConfirmed() => voidAfter the document is confirmed.
classNamestring

Customisation

Without editing the source, you can change:

Class names
className
Messages
expenses.approvalPolicies.document

Or edit the installed file directly: it is your code. See theming for colours and fonts.

Hooks

The SDK hooks this component uses. Use them directly from @dolfinai/react to build your own version.

useExpensePolicyDocumentReviewuseExpensePolicyFormatuseExpensePolicyReferenceDatauseMessages

Files

Written to your app by the install command:

  • components/dolfin/expenses/policy-document-review.tsx 216 lines