{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "code-diff-review",
  "title": "Code — Diff Review",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-react/blocks/code-diff-review/CodeDiffReview.tsx",
      "content": "'use client'\n\nimport { Check, FileDiff, MessageSquare } from 'lucide-react'\nimport { Avatar, AvatarFallback } from '@/components/ui/avatar'\nimport { Badge } from '@/components/ui/badge'\nimport { Button } from '@/components/ui/button'\nimport { Card, CardContent } from '@/components/ui/card'\nimport { Separator } from '@/components/ui/separator'\n\n// tone drives the row treatment, so individual lines carry no styling of their own.\nconst hunk = [\n  { old: 12, new: 12, tone: 'same', text: 'metric revenue_net {' },\n  { old: 13, new: 13, tone: 'same', text: '  owner: finance-analytics' },\n  { old: 14, new: null, tone: 'remove', text: '  window: trailing_30d' },\n  { old: null, new: 14, tone: 'add', text: '  window: trailing_28d' },\n  { old: null, new: 15, tone: 'add', text: '  restated_from: 2026-01-01' },\n  { old: 15, new: 16, tone: 'same', text: '  source: warehouse.orders' },\n  { old: 16, new: 17, tone: 'same', text: '}' },\n]\n\nconst added = hunk.filter((line) => line.tone === 'add').length\nconst removed = hunk.filter((line) => line.tone === 'remove').length\n\nfunction rowClass(tone: string) {\n  if (tone === 'add') return 'bg-success/10 text-foreground'\n  if (tone === 'remove') return 'bg-destructive/10 text-muted-foreground'\n  return 'text-muted-foreground'\n}\n\nfunction marker(tone: string) {\n  return tone === 'add' ? '+' : tone === 'remove' ? '-' : ' '\n}\n\nexport function CodeDiffReview() {\n  return (\n    <section data-slot=\"code-diff-review\" className=\"bg-background\">\n      <div className=\"mx-auto max-w-3xl px-6 py-20\">\n        <Badge variant=\"secondary\" className=\"gap-1.5\">\n          <FileDiff className=\"size-3\" aria-hidden=\"true\" />\n          Change review\n        </Badge>\n        <h2 className=\"mt-4 text-2xl font-semibold tracking-tight\">Every metric change is a reviewable diff</h2>\n        <p className=\"text-muted-foreground mt-2\">\n          Definitions live in the repo, so changing one opens a pull request with an owner and a revert path.\n        </p>\n\n        <Card className=\"mt-8\">\n          <CardContent className=\"p-0\">\n            <div className=\"border-border flex items-center gap-3 border-b px-4 py-2.5\">\n              <code className=\"min-w-0 truncate font-mono text-xs\">metrics/revenue_net.yml</code>\n              <div className=\"ml-auto flex shrink-0 items-center gap-2 font-mono text-xs\">\n                <span className=\"text-success\">+{added}</span>\n                <span className=\"text-destructive\">−{removed}</span>\n              </div>\n            </div>\n\n            <div className=\"overflow-x-auto\">\n              <table className=\"w-full border-collapse font-mono text-xs\">\n                <caption className=\"sr-only\">Unified diff for metrics/revenue_net.yml</caption>\n                <tbody>\n                  {hunk.map((line, index) => (\n                    <tr key={index} className={rowClass(line.tone)}>\n                      <td className=\"text-muted-foreground/60 w-10 px-2 py-1 text-right select-none\">\n                        {line.old ?? ''}\n                      </td>\n                      <td className=\"text-muted-foreground/60 w-10 px-2 py-1 text-right select-none\">\n                        {line.new ?? ''}\n                      </td>\n                      <td className=\"w-4 py-1 pl-2 select-none\">{marker(line.tone)}</td>\n                      <td className=\"py-1 pr-4 whitespace-pre\">{line.text}</td>\n                    </tr>\n                  ))}\n                </tbody>\n              </table>\n            </div>\n\n            <Separator />\n\n            <div className=\"flex items-start gap-3 px-4 py-3\">\n              <Avatar className=\"size-7\">\n                <AvatarFallback className=\"text-xs\">EW</AvatarFallback>\n              </Avatar>\n              <div className=\"min-w-0\">\n                <p className=\"text-xs\">\n                  <span className=\"font-medium\">Erin Walsh</span>\n                  <span className=\"text-muted-foreground\"> on line 14</span>\n                </p>\n                <p className=\"text-muted-foreground mt-1 text-xs leading-relaxed\">\n                  Restating from January means Q1 reports change. Flag it in the release note before this merges.\n                </p>\n              </div>\n              <Button variant=\"ghost\" size=\"sm\" className=\"ml-auto h-7 shrink-0 gap-1.5 text-xs\">\n                <MessageSquare className=\"size-3\" aria-hidden=\"true\" />\n                Reply\n              </Button>\n            </div>\n          </CardContent>\n        </Card>\n\n        <div className=\"text-muted-foreground mt-4 flex flex-wrap items-center gap-x-5 gap-y-2 text-xs\">\n          <span className=\"flex items-center gap-1.5\">\n            <Check className=\"text-success size-3.5\" aria-hidden=\"true\" />\n            Reconciliation passed against the prior four quarters\n          </span>\n          <span className=\"flex items-center gap-1.5\">\n            <Check className=\"text-success size-3.5\" aria-hidden=\"true\" />\n            41 downstream consumers identified\n          </span>\n        </div>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:block",
      "target": "~/components/blocks/CodeDiffReview.tsx"
    }
  ],
  "dependencies": [
    "lucide-react"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://uipkge.dev/r/react/avatar.json",
    "https://uipkge.dev/r/react/badge.json",
    "https://uipkge.dev/r/react/button.json",
    "https://uipkge.dev/r/react/card.json",
    "https://uipkge.dev/r/react/separator.json"
  ],
  "description": "Unified diff panel with added and removed lines, a file path header, a reviewer note anchored to a line, and a summary bar counting the changes.",
  "categories": [
    "marketing"
  ]
}