Bill pre-submit review
What to look at before a bill in review is submitted: a possible duplicate, dates, fields and lines the checks flagged, amounts that don't reconcile and an uncertain supplier, then Submit for review. By id it runs useBillPreSubmit; or pass your own issues. Checks that could not run show an error with Try again, never a clean result; a blocking issue holds Submit with the reason.
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/ap-bill-presubmit-reviewAlso installs: button, base-info-hint, base-states, base-theme, ui-ap-bill-presubmit-review.
Usage
import { BillPreSubmitReview } from "@/components/dolfin/ap/bill-presubmit-review";
// Place it anywhere inside your <DolfinProvider>.
<BillPreSubmitReview />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 |
|---|---|---|
billId | string | Runs the checks (`useBillPreSubmit`) and wires Submit for review from the SDK, where the bill allows it. |
issues | readonly BillPreSubmitIssue[] | Your issues (from `useBillPreSubmit(id).issues` or your own). Passing them (or `loading` or `error`) fetches nothing, and Submit shows only with `onSubmitReview`. Given with `billId`, the issues win. |
loading | boolean | The checks are still running. |
error | Error | The checks could not run (`useBillPreSubmit(id).checksError`, or the bill's read). Never read as "Everything checks out": without issues the error state shows; with some, they stay under an inline error. |
onRetry | () => void | Shows "Try again" in the error state. By id, reads the bill and its checks again unless you pass your own. |
onSubmitReview | () => void | Shows Submit for review. By id, yours replaces the SDK's. The same name, reason and progress as on `BillActions`, so one set of props drives both. |
pendingAction | BillActionName | The bill action running now (`BillActions`' `pendingAction`): `"submitReview"` spins Submit; any other holds it. By id, `undefined` means the SDK's own progress. |
submitReviewDisabledReason | string | A non-empty reason disables Submit and explains why in an InfoHint; `""` keeps it enabled. `undefined` means the SDK's reason: an open blocking issue holds Submit until it is fixed (and, by id, the user's role). |
className | string |
Customisation
Without editing the source, you can change:
- Class names
className- Messages
ap.bill.actionsap.billPreSubmitap.fieldsap.fixFirstap.issuesap.readyap.readyWithNotesap.toCheckap.toFixap.unnamedFieldap.unnamedLineFieldbase.infoHint.moreAboutbase.states
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.
useBilluseBillActionsuseBillPermissionsuseBillPreSubmituseMessagesFiles
Written to your app by the install command:
components/dolfin/ap/bill-presubmit-review.tsx217 lines