# FileProcessing

> File upload and processing stage progress.

## Install

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

## Import

```tsx
import { FileProcessing } from "@/components/agent-wait-states/file-processing";
```

## 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. |
| `filename` | `string` | no |  |  |
| `size` | `string` | no |  |  |
| `stage` | `FileStage` | no | `"uploading"` |  |
| `progress` | `number` | no | `0` |  |

## States

FileProcessing shows a different state for each value of `stage`:

- `stage`: `uploading`, `reading`, `chunking`, `ready`

## Labels

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

| Label | English default |
| --- | --- |
| `fileProgress` | `` (percent, f) => `${f.number(percent)}%` `` |
| `fileUploading` | `"Upload"` |
| `fileReading` | `"Reading"` |
| `fileChunking` | `"Chunking"` |
| `fileReady` | `"Ready"` |

## Types

```ts
export type FileStage = "uploading" | "reading" | "chunking" | "ready";
```

## Example

```tsx
<FileProcessing filename="report.pdf" size="2.4 MB" stage="chunking" progress={72} accent />
```
