# Approval

> A human approval prompt with optional expiry.

## Install

```bash
npx shadcn@latest add https://crate.onerollstudios.com/r/approval.json
```

## Import

```tsx
import { Approval } from "@/components/agent-wait-states/approval";
```

## Props

| Prop | Type | Required | Default | Notes |
| --- | --- | --- | --- | --- |
| `className` | `string` | no |  |  |
| `accent` | `boolean` | no | `false` |  |
| `labels` | `Partial<CrateLabels>` | no |  | Replace any of this component's labels. Overrides CrateProvider. |
| `title` | `string` | no |  |  |
| `preview` | `ReactNode` | no |  |  |
| `onAllow` | `(() => void)` | no |  |  |
| `onDeny` | `(() => void)` | no |  |  |
| `expiresIn` | `number` | no |  |  |

## Labels

Override with the `labels` prop or a `CrateProvider`.

| Label | English default |
| --- | --- |
| `approvalRequired` | `"Approval required"` |
| `approvalTitle` | `"The agent wants to send this email"` |
| `expiresIn` | `` (seconds, f) => `Expires in ${f.seconds(seconds)}` `` |
| `approvalPreview` | `"Review this action before it runs."` |
| `deny` | `"Deny"` |
| `allow` | `"Allow"` |

## Example

```tsx
<Approval preview={action} onAllow={allow} onDeny={deny} expiresIn={30} accent />
```
