# Money Preview

> Money that moves: the amount large and with cents, the currency (EUR by default, formatted in the provider's locale), the recipient masked, account and reference, the bookings it writes with their sum, or the payment a refund goes back to.

Component · AI · Pro kit · [Live page](https://ui.twentyfirst.media/pro/components/MoneyPreview/)

Money that moves: the amount large and with cents, the currency (EUR by default, formatted in the provider's locale), the recipient masked, account and reference, the bookings it writes with their sum, or the payment a refund goes back to. Shows "Needs a fresh passkey" unless `stepUp={false}`; pair it with `ApprovalCard stepUp`.

## Example

```tsx
import * as React from "react";
import { ApprovalCard, MoneyPreview } from "@twentyfirstmedia/pro";
import type { ApprovalDecision } from "@twentyfirstmedia/pro";
import { fakeDecision } from "./_approvals";

export default function Preview() {
  const [decision, setDecision] = React.useState<ApprovalDecision | null>(null);
  return (
    <div className="tf-col" style={{ gap: 16 }}>
      <ApprovalCard
        agent="Ledger"
        project="Billing"
        family="money"
        age="38 min"
        title="Refund €10.00 to the card ending 4242"
        text="The customer was charged twice for order 2041."
        escalation="Escalates to the owner in 1:22 h"
        stepUp
        decision={decision}
        onDecide={async (key, text) => {
          await fakeDecision(key);
          setDecision({ key, text, by: "Mara Ellis", at: "09:41" });
        }}
      >
        <MoneyPreview
          amount={10}
          recipient="Visa …4242"
          reference="Order 2041"
          refund={{ payment: "pay_3PqL8x2k", paidAt: "Apr 14, 18:02", original: 10 }}
        />
      </ApprovalCard>
      <ApprovalCard
        agent="Ledger"
        project="Finance"
        family="money"
        age="2 h"
        title="Book 3 receipts from March"
        compact
      >
        <MoneyPreview
          amount={-327.25}
          account="Business account"
          bookings={[
            { id: 1, date: "Mar 3", text: "Hosting", account: "4920 · IT costs", amount: -119 },
            {
              id: 2,
              date: "Mar 9",
              text: "Train tickets",
              account: "4670 · Travel",
              amount: -88.25,
            },
            {
              id: 3,
              date: "Mar 21",
              text: "Office chairs",
              account: "0650 · Furniture",
              amount: -120,
            },
          ]}
        />
      </ApprovalCard>
    </div>
  );
}
```

## Props

### MoneyPreview

| Prop | Type | Notes |
| --- | --- | --- |
| `title?` | `ReactNode` |  |
| `amount` | `number` | In the currency's units (12.5 = €12.50); negative for money going out of a booking. |
| `currency?` | `string` | ISO code (default EUR). |
| `recipient?` | `string` | Already masked ("DE89 …3000", "…4242"). |
| `reference?` | `ReactNode` |  |
| `account?` | `ReactNode` |  |
| `bookings?` | `MoneyBooking[]` | The bookings this writes, with their sum below. |
| `refund?` | `{ payment: ReactNode; paidAt?: ReactNode; original?: number }` | A refund: the payment it goes back to. |
| `stepUp?` | `boolean` | Shows "Needs a fresh passkey" (default true). |
| `facts?` | `KeyValueItem[]` |  |
| `warnings?` | `ReactNode[]` |  |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### ApprovalCard

| Prop | Type | Notes |
| --- | --- | --- |
| `title` | `ReactNode` | Required |
| `text?` | `ReactNode` |  |
| `children?` | `ReactNode` |  |
| `agent?` | `string` |  |
| `project?` | `string` |  |
| `family?` | `RiskFamily` |  |
| `familyLabel?` | `string` |  |
| `age?` | `string` |  |
| `escalation?` | `ReactNode` |  |
| `trace?` | `ReactNode` |  |
| `note?` | `ReactNode` |  |
| `heading?` | `string` |  |
| `options?` | `ApprovalOption[]` |  |
| `approveLabel?` | `string` |  |
| `onDecide?` | `(key: ApprovalKey, text?: string) => void \| Promise<unknown>` | Called with the answer (and the text of B or D). Return a Promise to keep the card busy until it settles: the answer's button spins and every answer is disabled; a rejection shows an error (a rejected string is shown as is) and keeps the card open. Once it resolves, a card without a `decision` prop collapses to its one-line record; with a plain callback, set `decision` yourself. |
| `decision?` | `ApprovalDecision \| null` | The decision record: shown as one line instead of the card; `null` keeps the card open. |
| `compact?` | `boolean` | Side panels: tighter, the answers in a row, the payload folded behind "Show what runs" (one click, never a summary). |
| `stepUp?` | `boolean` | Money, legal and infrastructure decisions: A and B (the answers that run something) need a fresh passkey. They show "Needs your passkey"; while `onDecide` is pending the pressed answer says "Confirm with passkey". Do the WebAuthn step-up in `onDecide` and reject if it fails. |
| `busy?` | `ApprovalKey \| null` | The answer being sent, when you track it yourself (controlled busy state). |
| `error?` | `ReactNode` | An error to show above the answers (controlled); a rejected `onDecide` shows one by itself. |
| `screen?` | `boolean` | Fills its container, e.g. a deep link on a phone: the content scrolls and A–D stay at the bottom, full width, in thumb reach (with the safe area). |
| `href?` | `string` | Makes the title a link to the full approval (with `linkAs` for a router's link). |
| `linkAs?` | `ElementType` |  |
| `onApprove?` | `() => void` |  |
| `onDeny?` | `() => void` |  |
| `onEdit?` | `(text: string) => void` |  |
| `state?` | `"approved" \| "denied"` |  |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |
