{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "markdown-renderer",
  "type": "registry:ui",
  "title": "Markdown renderer",
  "description": "A small React renderer for AI output that splits text into paragraphs on blank lines and turns fenced code blocks into scrollable monospace panels.",
  "dependencies": [],
  "registryDependencies": [
    "utils"
  ],
  "files": [
    {
      "path": "registry/ui/markdown-renderer.tsx",
      "type": "registry:ui",
      "target": "components/ui/markdown-renderer.tsx",
      "content": "\"use client\"\nimport * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\n\n/** MarkdownRenderer — paragraphs and fenced code blocks from a markdown string, with no parser dependency. */\n\n// A note from the Lumen developer docs: paragraphs and one fenced code block.\nconst SAMPLE_CONTENT = `Lumen sends a webhook the moment an invoice is paid. Verify the signature header, then mark the order as settled in your own system.\n\n\\`\\`\\`json\n{\n  \"event\": \"invoice.paid\",\n  \"invoice\": \"INV-2041\",\n  \"customer\": \"Northwind\",\n  \"amount\": 12400,\n  \"currency\": \"USD\",\n  \"paid_at\": \"2026-10-14T09:42:00Z\"\n}\n\\`\\`\\`\n\nDeliveries retry with exponential backoff for 24 hours. Return a 2xx within five seconds or the attempt is marked failed and queued again.`\n\ntype MarkdownRendererProps = {\n  /** Markdown source. Paragraphs and fenced code blocks are rendered; other syntax is shown as plain text. */\n  content?: string\n  className?: string\n}\n\nfunction MarkdownRenderer({ content = SAMPLE_CONTENT, className }: MarkdownRendererProps) {\n  const parts = content.split(/```[\\w]*\\n?/)\n  return (\n    <div data-slot=\"markdown-renderer\" className={cn(\"space-y-3 text-sm leading-[1.55] text-fg\", className)}>\n      {parts.map((part, i) =>\n        i % 2 === 1 ? (\n          <pre key={i} className=\"overflow-auto rounded-lg border border-border bg-sunken p-3 text-xs\">\n            <code>{part.replace(/\\n$/, \"\")}</code>\n          </pre>\n        ) : (\n          part\n            .split(/\\n\\n+/)\n            .filter(Boolean)\n            .map((p, j) => <p key={`${i}-${j}`}>{p}</p>)\n        )\n      )}\n    </div>\n  )\n}\nexport { MarkdownRenderer }\nexport type { MarkdownRendererProps }\n"
    }
  ]
}
