# Report reply

Flag a reply for a person to review: why, and an optional note. Who reviews it is the service's policy and is passed in, so the confirmation says where the report actually went. Sent once; the button then shows it was sent.

- Registry name: `report-reply` (`@candor/report-reply`)
- Tier: Pro. Installing it needs a Pro, Premium or Team licence key: the person runs `npx candor-ui key <key>` themselves; never ask for the key in chat or write it to a file.
- Docs: https://candor.themethodic.com/docs/report-reply

## Install

```bash
npx candor-ui add report-reply
```

Run `npx candor-ui@latest init` once first (https://candor.themethodic.com/get-started.md). Without the CLI: `npx shadcn@latest add @candor/report-reply`.
It brings in: button, locale, popover, utils.
npm packages: lucide-react@^1.67.0.

## Example

```tsx
"use client"

import { ReportReply } from "@/components/report-reply"

export default function Example() {
  return (
    <div className="flex max-w-lg flex-col gap-2">
      <p className="text-sm">The orders table has no index on customer_id, so I’ve drafted a migration that adds one.</p>
      <ReportReply reviewer="the Keel quality team" onReport={() => {}} />
    </div>
  )
}
```

## <ReportReply>

Props:

- `reviewer: string`: Who sees the report, e.g. "the quality team".
- `onReport: (reason: ReportReason, note: string) => void | Promise<void>`: Called on send with the reason and the trimmed note (empty if none); the send button waits on a returned promise.
- `className?: string | undefined`

## Strings (`reportReply`)

The fixed words, English by default. Override any of them under `reportReply` in `<LocaleProvider strings={{ reportReply: { … } }}>`; the table is exported as `reportReplyStrings`.

- `wrong`: It’s wrong
- `wrongDetail`: A fact, number or name doesn’t match reality
- `unsafe`: It proposed something unsafe
- `unsafeDetail`: A change that could break or expose something
- `harmful`: It’s harmful or inappropriate
- `harmfulDetail`: Offensive, biased, or shouldn’t have been said
- `other`: Something else
- `otherDetail`: Say what in the note
- `reported`: Reported to {reviewer}
- `report`: Report this reply
- `question`: What’s wrong with this reply?
- `note`: Note (optional)
- `goesTo`: Goes to {reviewer}, with this reply and the thread up to it.
- `send`: Report

## Types

### ReportReason

```ts
"wrong" | "unsafe" | "harmful" | "other"
```

## Rules for using Candor UI

- Components take plain typed data. Never pass model output as HTML or render it as a link; messages are typed blocks.
- A control that can't be used says why: wrap it in `<Locked reason="…">`, don't just disable it.
- Don't show a value you don't have: leave it out (it renders as —) rather than guess. An estimate is labelled as one.
- Nothing is pre-selected in a decision a person makes, and the agent is named from your app's data, never from model output.
- Your app's words go in `LocaleProvider` (fixed strings) and `TermsProvider` (nouns); entity kinds and agent roles in `EntityKindsProvider` and `AgentRolesProvider`.
