ApprovalQueue

Pending-approval inbox view. Renders one card per record in the surrounding <ListContext> (typically scoped to status=pending via <List filter>). Each card has approve + reject buttons. On click, writes { status, approverId, approverNote, decidedAt } atomically.

Installation

pnpm dlx shadcn@latest add @shadmin/approval-queue

Usage

import { ApprovalQueue, List } from "@/components/admin";
 
const ExpenseApprovals = () => (
  <List resource="expenses" filter={{ status: "pending" }}>
    <ApprovalQueue titleSource="title" subtitleSource="amount" requireReason />
  </List>
);

Props

PropRequiredTypeDefaultDescription
titleSourceOptionalstring"title"Field for the row heading
subtitleSourceOptionalstring-Optional secondary text
statusSourceOptionalstring"status"Field written on decision
approverSourceOptionalstring"approverId"Field receiving the current user id
noteSourceOptionalstring"approverNote"Field receiving the reason note
decidedAtSourceOptionalstring"decidedAt"Field receiving the ISO timestamp
requireReasonOptionalbooleanfalseBlock reject (and approve) without a reason
rowExtraOptional(record) => ReactNode-Custom slot between header and action row

Required parent context

<ApprovalQueue> must be rendered inside a <List> / <ListBase> parent so useListContext() resolves. The component itself does not fetch data.