# App, assistant approval

- **[Sections](/blocks/)**
- **[Application](/blocks/app/)**
- **App, assistant approval**

An action the assistant wants to take and needs a person to allow: title, why, scoped detail, a risk level and Approve / Deny buttons named after the action.

## Import

- **CLI**

  ```
  npx shadcn add @klarhimmel/app-assistant-approval
  ```
- **Import**

  ```
  import Block from '@/components/klarhimmel/blocks/app-assistant-approval';
  ```

Also called

- app/assistant-approval

- **About**: An action the assistant wants to take and needs a person to allow: title, why, scoped detail, a risk level and Approve / Deny buttons named after the action. Pending, approved and denied via the state prop.
- **Category**: Interface sections for signed-in products. New project? Set it up once: /get-started/installation.

## Notes

- **When to use it**: A card where the assistant asks a person to allow one specific action before it runs, with a risk level and a scope list. For a plain status line of something the assistant already did, use `app-assistant-tool-call`; for the whole conversation, `app-assistant-thread`.
- **Writing for it**: - Write the title as the action itself in plain words, up to 80 characters, and repeat it in `action` (60 characters): the buttons are read to screen readers as the button text plus that action.
- The scope list takes 1 to 4 label and value pairs, labels up to 30 characters and values up to 300. Use labels like Touches, Changes, Sends and Undo so the person sees the blast radius before choosing.
- Set `risk` to match the real consequence. High adds a warning icon beside the badge, so reserve it for things that cannot be taken back.
- **Watch out for**: This block is strict. If any text field breaks its limit or is missing, it does not fall back to default copy: it shows a notice that the request could not be shown, with Approve and Deny disabled. Once a person decides, the buttons disappear and `resolvedNote` is shown next to the outcome.

## Pairs well with

- **[App, assistant thread](/blocks/app/assistant-thread)**
- **[App, assistant tool call](/blocks/app/assistant-tool-call)**
- **[App, assistant composer](/blocks/app/assistant-composer)**

## Usage

The block in a page, with its default content (long lists shortened). Every prop is in the table below.

section.tsx

```
import { Theme } from '@/components/klarhimmel/theme/style';
import { BlockSurface } from '@/components/klarhimmel/blocks/surface';
import AppAssistantApproval from '@/components/klarhimmel/blocks/app-assistant-approval';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <AppAssistantApproval props={{
          "state": "pending",
          "risk": "medium",
          "title": "Say what the assistant wants to do",
          "description": "Say why the assistant wants this and what it will do, in one or two sentences, with the key fact.",
          "scope": [
            {
              "label": "Touches",
              "value": "Name what it acts on, with its identifier"
            },
            {
              "label": "Changes",
              "value": "Say what changes and by how much"
            },
            {
              "label": "Sends",
              "value": "Say what is sent and to whom"
            },
            {
              "label": "Undo",
              "value": "Say how it can be undone and what cannot be"
            }
          ],
          "action": "do this action",
          "approve": "Approve",
          "deny": "Deny",
          "labels": {
            "approved": "Approved",
            "denied": "Denied",
            "low": "Low risk",
            "medium": "Medium risk",
            "high": "High risk"
          }
        }} />
      </BlockSurface>
    </Theme>
  );
}
```

## Props

The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.

- **state**: One of 'pending', 'approved', 'denied'.
- **risk**: One of 'none', 'low', 'medium', 'high'.
- **title**: Text, up to 80 characters.
- **description**: Text, up to 240 characters.
- **scope**: List of 1 to 4. Each item: label, value.
- **action**: Text, up to 60 characters.
- **approve**: Text, up to 24 characters.
- **deny**: Text, up to 24 characters.
- **resolvedNote**: Text, up to 200 characters. Optional; empty is not rendered.
- **labels**: Fields: approved, denied, low, medium, high.
- **headingLevel**: One of '1', '2'. Optional; empty is not rendered.

[Previous](/blocks/app/access-detail)

[Next](/blocks/app/assistant-composer)
