Commerce
Checkout links table
CheckoutLinksTable — exported from the library at `src/components/checkout-links/CheckoutLinksTable.tsx`. Awaiting a written description.
Available
Ports as-is
Examples
Rendered live from the maintained Storybook story. Lantern stores only the story id and embeds Storybook rather than duplicating the component or its demo.
Checkout links table
Rendered live from Storybook
Storybook must be running for this to load — bun run start:storybook from the monorepo root, or set NEXT_PUBLIC_STORYBOOK_URL to a deployed instance.
Props
The component's public API, read from its TypeScript source. Descriptions come from TSDoc on the prop, so this table cannot drift from the component.
| Prop | Type | Default | Description |
|---|---|---|---|
links* | CheckoutLink[] | — | Undocumented — add TSDoc to the prop in the library. |
selectionMode | boolean | false | Reveals the checkbox column and the floating bulk-actions toolbar. |
onExitSelectionMode | () => void | — | Cancel or Escape was pressed in selection mode. |
onDelete | (ids: string[]) => void | — | Delete was confirmed, for one id or for the whole selection. |
onSelectLink | (link: CheckoutLink) => void | — | A row was activated (click or Enter/Space). Replaces `navigate(href)`. |
onEditLink | (link: CheckoutLink) => void | — | Edit was chosen from a row's overflow menu. |
onPreviewLink | (link: CheckoutLink) => void | — | Preview was chosen. The app serialised the whole link into a query string and `window.open`ed a preview route — see the promotion note. |
onExport | (ids: string[]) => void | — | Export was pressed in the bulk toolbar. The app's handler was an empty stub. |
getHref | (link: CheckoutLink) => string | — | Row href, used by the "View link" menu item. Defaults to `/creator/apps/checkout-links/{id}`. |
spaceId | string | — | Appended as `?space=` to the default href. Replaces the router's search param. |
defaultSelectedIds | string[] | — | Uncontrolled initial selection, so "3 selected" is a static story. |
selectedIds | string[] | — | Controlled selection. |
onSelectionChange | (ids: string[]) => void | — | Undocumented — add TSDoc to the prop in the library. |
defaultPage | number | 0 | Uncontrolled initial page index (zero-based). |
pageSize | number | 20 | Rows per page. |
defaultDeleteTarget | CheckoutLinksTableDeleteTarget | null | null | Uncontrolled seed for the delete confirmation, so the open dialog is a static story. `"bulk"` targets the current selection. |
currencySymbol | string | "$" | Prefix on prices. BTS prices in AUD, hence the bare `$`. |
emptyCartPriceLabel | string | "-" | Price cell for a dynamic (empty-cart) link, which has no single price. |
emptyLabel | string | "No links found" | Shown when `links` is empty. |
className | string | — | Undocumented — add TSDoc to the prop in the library. |
Reference
Transcribed from the component audit. If this disagrees with the source, the source is right.
- Source
src/components/checkout-links/CheckoutLinksTable.tsx- Portability
- Copies across unchanged — only the utils import path moves.