Loading component…
Loading component…
What the agents did while you were away – the night as a small chart with a peak per event, then a board of what needs you, what failed and what's done, acted on right on the card
To reuse this local React demo, copy all files from the Code tab into the same folder, then import AgentRecap from ./agent-recap.
import { AgentRecap, type RecapEvent } from "@/components/ui/agent-recap";
const events: RecapEvent[] = [
{ id: "refund", kind: "needs", at: "2026-10-30T02:14", title: "Refund $240 to Acme Corp",
detail: "Over the $200 auto-approve limit", action: "Approve", doneLabel: "Approved" },
{ id: "sync", kind: "failed", at: "2026-10-30T03:02", title: "Contact sync to the CRM",
detail: "Token expired after 1,284 of 3,900 contacts" },
{ id: "tickets", kind: "done", at: "2026-10-29T19:05", title: "Answered support tickets", count: 38 },
];
export function Morning() {
return <AgentRecap events={events} since={lastSeenAt} onAction={(e, a) => handle(e, a)} />;
}| Name | Type | Default | Description |
|---|---|---|---|
| events | RecapEvent[] | { id, at, kind, title, detail?, logo?, count?, action?, doneLabel? } – everything that happened, any order | |
| kind | "needs" \| "failed" \| "done" | Per event – needs you (with its action), failed (with Retry) or done | |
| since / until | Date \| string \| number | When the person left, and now – the chart runs between them; until defaults to the time it renders | |
| onAction | (event, action: "primary" \| "review") => void \| Promise | The main action (Approve, Retry …) or Review. Return a promise and the row shows it working until it settles – a rejected one puts the row back | |
| onUndo / onRedo | (event) => void | Undo on a card that was acted on or on something an agent did (a done card), and Redo after that | |
| limit | number | 3 | Cards per lane at most – every lane keeps room for this many, so the three stay the same height however full they are |
| replay | number | 1800 | How long the night replays when it opens, in ms – 0 shows everything at once |
| title | string | "While you were away" | Heading |
| locale | string | For the times and counts | |
| className | string | Extra class on the root |
Every card is the same height and ends in the same line – a state tag (Done, Fixed, Approved) and the buttons – so acting on one never moves anything
Under 640px the three lanes stack
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"