Match line
One bill line of a three-way match, as a workspace row or a compact card: ordered, billed and received quantities, the line's state, variance badges, the variance sentence with Accept, Request credit note and Dispute (or Undo), the engine's suggestions with confidence, and the matched purchase orders and delivery notes. Wired by the callbacks you pass (a button shows only with one; read-only with none), with the line's own progress and error. Exported with its parts so hosts can build their own review layouts.
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
Works with Dolfin’s SDK context, 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-match-lineAlso installs: button, base-info-hint, base-status-badge, ui-ap-match-line.
Usage
import { MatchLine } from "@/components/dolfin/ap/match-line";
// Place it anywhere inside your <DolfinProvider>.
<MatchLine line={line} currency={currency} />Renders inside DolfinProvider (set it up once). It renders the data you pass as props.
API reference
| Prop | Type | Description |
|---|---|---|
line required | MatchLineModel | |
currency required | string | |
pending | boolean | A command is running on this line: it shows progress and keeps its buttons disabled. |
error | string | Why the last command on this line failed, shown on the line. |
variant | "card" | "row" | `row` is a workspace grid row; `card` is the compact block the bill page's panel stacks. |
inDeliveryWindow | ReadonlySet<string> | Purchase orders expected near the invoice date, to tag their suggestions. |
onMatchManually | (line: MatchLineModel) => void | Shows "Match manually" while the line can take one; open your matching dialog here. |
footer | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Extra content at the end of the line (notes, your own actions). |
className | string | |
onConfirm | (pick: MatchLinePick) => void | Confirm one of the engine's suggestions. |
onResolve | (action: MatchLineResolveAction) => void | |
onDispute | () => void | |
onUndo | () => void | Take back the decision recorded on the line. |
onUnlink | (allocationId: string) => void | Remove one of the line's matched documents. |
disabled | boolean | Keeps the buttons disabled, e.g. while any write on the match runs. |
Customisation
Without editing the source, you can change:
- Class names
className- Messages
ap.matchbase.infoHint.moreAbout
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.
useDolfinLocaleuseMessagesFiles
Written to your app by the install command:
components/dolfin/ap/match-line.tsx170 linescomponents/dolfin/ap/match-line-parts.tsx387 linescomponents/dolfin/ap/match-line-format.tsx79 lines