Expense close and receipts
Last month's close (share posted to the accounting platform, with a chip per blocking state that opens the view clearing it) and receipt coverage (age of the missing ones, whom to chase, a link to the missing receipts), read from the compliance report with loading, empty and error states.
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
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/expenses-report-complianceAlso installs: button, base-theme, base-money, expenses-report-card, ui-expenses-report-compliance.
Usage
import { ExpensesReceiptsCard } from "@/components/dolfin/expenses/report-compliance";
// Place it anywhere inside your <DolfinProvider>.
<ExpensesReceiptsCard />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 |
|---|---|---|
report | { asOf?: string; period?: components["schemas"]["LookbackPeriod"]; periodStart?: string; periodEnd?: string; currency: string; mixedCurrency… | The report you already hold; `null` while you have none. |
loading | boolean | |
error | Error | |
onRetry | () => void | |
title | string | Overrides the card's title. |
className | string | |
period | "Last7Days" | "Last30Days" | "Last90Days" | "MonthToDate" | "QuarterToDate" | "YearToDate" | "Last12Months" | Defaults to the last 30 days. |
scope | SpenderScope | Whose spend; defaults to everyone. `mine` needs a user session (an API key has no "me"). |
Customisation
Without editing the source, you can change:
- Class names
className- Messages
expenses.expenses.statesexpenses.home
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.
useDolfinLocaleuseExpensesComplianceReportuseMessagesFiles
Written to your app by the install command:
components/dolfin/expenses/report-compliance.tsx151 lines