# WorkSummary

The steps of one agent turn, open while it works and collapsed to "Worked for 15s" after.

- **Use it for**: The steps of one agent turn, collapsed to how long it took once done.
- **Not for**: Reasoning text, or runs across many threads. Try [Reasoning](https://unseenui.com/components/reasoning/), [RunBoard](https://unseenui.com/components/run-board/).

## Installation

```bash
npm install @stackunseen/ui
```

## Usage

```tsx
import { WorkSummary } from '@stackunseen/ui/assistant';
import '@stackunseen/ui/styles.css';

<WorkSummary steps={turn.steps} state="done" startedAt={turn.startedAt} durationMs={turn.elapsedMs} />
```

## All props

| Prop | Type | Description |
| --- | --- | --- |
| `children` | `ReactNode` | Anything else about the turn, such as a terminal log, shown under the steps. |
| `className` | `string` |  |
| `defaultOpen` | `boolean` |  |
| `durationMs` | `number` | Host-measured duration, preferred over the browser clock. |
| `endedAt` | `string \| number \| Date` | When it ended. |
| `onOpenChange` | `((open: boolean) => void)` |  |
| `open` | `boolean` |  |
| `startedAt` (required) | `string \| number \| Date` |  |
| `state` (required) | `"running" \| "failed" \| "done" \| "stopped"` | "running" while the agent works; the others once it has ended. |
| `steps` (required) | `Step[]` | The public steps of one turn or run. |

## Keyboard

Tab reaches controls; Enter or Space activates buttons. Accordions use arrow keys, Home and End. Select menus support arrows and typeahead; Escape closes menus and dialogs and restores focus.

## Works with

[ChainOfThought](https://unseenui.com/components/chain-of-thought/), [Plan](https://unseenui.com/components/plan/), [WorkflowGraph](https://unseenui.com/components/workflow-graph/), [RunInspector](https://unseenui.com/components/run-inspector/), [ConnectionStatus](https://unseenui.com/components/connection-status/), [AgentSteps](https://unseenui.com/components/agent-steps/), [ExecutionTimeline](https://unseenui.com/components/execution-timeline/), [RunBoard](https://unseenui.com/components/run-board/), [AgentLanes](https://unseenui.com/components/agent-lanes/), [AttentionQueue](https://unseenui.com/components/attention-queue/), [RunSummaryCard](https://unseenui.com/components/run-summary-card/), [BackgroundStatus](https://unseenui.com/components/background-status/)

Page: https://unseenui.com/components/work-summary/
