# ApprovalBatch

Approve several similar proposals at once, and still leave any of them out.

- **Use it for**: Several same-scope proposals under one decision.
- **Not for**: Proposals with different targets or scopes. Try [ApprovalCard](https://unseenui.com/components/approval-card/).

## Installation

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

## Usage

```tsx
import { ApprovalBatch } from '@stackunseen/ui/conversation-flow';
import '@stackunseen/ui/styles.css';
import '@stackunseen/ui/conversation-flow.css';

<ApprovalBatch variant="card" proposals={proposals} excludedIds={excluded} onExcludedChange={setExcluded} onDecision={decide} />
```

## All props

| Prop | Type | Description |
| --- | --- | --- |
| `excludedIds` (required) | `readonly string[]` | Proposals the person pulled out of the batch; they stay listed but are not covered. |
| `label` | `string` |  |
| `now` | `string` | The host clock, for expiry. |
| `onDecision` (required) | `(decision: ApprovalBatchDecision) => void` |  |
| `onExcludedChange` (required) | `(ids: string[]) => void` |  |
| `proposals` (required) | `readonly ApprovalProposal[]` |  |
| `receipt` | `(CommandReceipt & { covered?: readonly string[]; })` | The host's receipt; `covered` lists the proposal ids the host actually applied the decision to. |
| `submission` | `SubmissionState` |  |
| `variant` | `"card" \| "inline"` |  |

## 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

[ApprovalCard](https://unseenui.com/components/approval-card/), [PermissionRequest](https://unseenui.com/components/permission-request/), [ReviewChanges](https://unseenui.com/components/review-changes/), [DryRunPreview](https://unseenui.com/components/dry-run-preview/), [ScopeGrant](https://unseenui.com/components/scope-grant/), [AccessModeSelector](https://unseenui.com/components/access-mode-selector/), [ClarificationRequest](https://unseenui.com/components/clarification-request/)

Page: https://unseenui.com/components/approval-batch/
