{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "tool-result-panel",
  "type": "registry:ui",
  "title": "Tool result panel",
  "description": "Tool result panel with the tool name, a success, error or running status badge and the output shown in a JSON code block. Built in React for AI agent UIs.",
  "dependencies": [],
  "registryDependencies": [
    "https://ui.minidev.pro/r/code-block.json",
    "https://ui.minidev.pro/r/status-badge.json",
    "utils"
  ],
  "files": [
    {
      "path": "registry/ui/tool-result-panel.tsx",
      "type": "registry:ui",
      "target": "components/ui/tool-result-panel.tsx",
      "content": "\"use client\"\nimport * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\nimport { StatusBadge } from \"@/components/ui/status-badge\"\nimport { CodeBlock } from \"@/components/ui/code-block\"\n\n/** A collapsed-chrome panel showing an AI tool call's name, status and JSON output. */\ntype ToolResultPanelProps = {\n  /** The tool that ran. */\n  name?: string\n  status?: \"success\" | \"error\" | \"running\"\n  /** Raw output, shown as JSON. Defaults to a Lumen invoice lookup. */\n  output?: string\n  className?: string\n}\n\nconst SAMPLE_OUTPUT = `{\n  \"invoice\": \"INV-2041\",\n  \"customer\": \"Northwind Traders\",\n  \"amount\": 12400,\n  \"currency\": \"USD\",\n  \"status\": \"paid\",\n  \"paid_at\": \"2026-03-12T09:41:00Z\"\n}`\n\nfunction ToolResultPanel({\n  name = \"lookup_invoice\",\n  status = \"success\",\n  output = SAMPLE_OUTPUT,\n  className,\n}: ToolResultPanelProps) {\n  const tone = status === \"running\" ? \"accent\" : status === \"error\" ? \"danger\" : \"success\"\n  const label = status === \"running\" ? \"Running\" : status === \"error\" ? \"Error\" : \"Success\"\n  return (\n    <div data-slot=\"tool-result-panel\" className={cn(\"w-full max-w-md overflow-hidden rounded-xl border border-border bg-surface\", className)}>\n      <div className=\"flex items-center justify-between gap-2 border-b border-border px-3 py-2\">\n        <span className=\"font-mono text-xs text-fg\">{name}</span>\n        <StatusBadge tone={tone}>{label}</StatusBadge>\n      </div>\n      <CodeBlock code={output} language=\"json\" className=\"rounded-none border-0\" />\n    </div>\n  )\n}\nexport { ToolResultPanel }\nexport type { ToolResultPanelProps }\n"
    }
  ]
}
