# Code Review Agent
Source: https://ui.spencerwueste.com/docs/blocks/code-review/
Markdown: https://ui.spencerwueste.com/llm/blocks/code-review.md

> Agent-proposed patch across files with per-hunk accept and reject.

> Live preview: https://ui.spencerwueste.com/preview/code-review

## What's inside

- **Diff View** renders each file's hunks with accept and reject actions and a decision badge afterwards.
- **Message** shows the agent's summary above the diff.
- **File list** tracks which files are fully decided and the header applies accepted hunks.

## Installation

```bash
npx shadcn@latest add https://ui.spencerwueste.com/r/code-review.json
```

Manual install dependencies: `@heroicons-animated/react motion`

Registry JSON: https://ui.spencerwueste.com/r/code-review.json

The registry item pulls in every component it depends on.

## Usage

```tsx
import CodeReview from "@/components/blocks/code-review/code-review";

export default function Page() {
  return (
    <div className="h-dvh p-4">
      <CodeReview />
    </div>
  );
}
```

Give the parent a bounded height. The block fills it and scrolls internally.

## Going live

Feed `files` from your agent's proposed changes as before and after strings, or pass hunks straight from a unified diff. Post the `decisions` map back to the agent so it can apply accepted hunks and revise rejected ones.
