{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "markdown",
  "type": "registry:component",
  "title": "Markdown",
  "description": "Markdown renderer component",
  "registryDependencies": [],
  "files": [
    {
      "path": "components/chatcn/ai/markdown.tsx",
      "content": "import React from \"react\";\nimport { default as MarkdownRender } from \"react-markdown\";\nimport remarkGfm from \"remark-gfm\";\nimport { cn } from \"@/lib/utils\";\nimport { CodeBlock } from \"@/components/chatcn/ai/codeblock\";\n\ntype MarkDownProps = {\n  children: React.ReactNode;\n  className?: string;\n  theme?: string;\n};\n\nexport function Markdown({ children, className, theme }: MarkDownProps) {\n  return (\n    <div\n      className={cn(\n        \"prose dark:prose-invert max-w-4xl px-3 prose-pre:p-0 prose-pre:resize-none\",\n        className\n      )}\n    >\n      <MarkdownRender\n        components={{\n          code({ className, children, ...props }) {\n            const match = /language-(\\w+)/.exec(className || \"\");\n            return match ? (\n              <CodeBlock\n                {...props}\n                lang={\"tsx\"}\n                theme={\n                  theme == \"dark\"\n                    ? \"github-dark-default\"\n                    : \"github-light-default\"\n                }\n                className={cn(\"not-prose\")}\n              >\n                {String(children).replace(/\\n$/, \"\")}\n              </CodeBlock>\n            ) : (\n              <code className={className} {...props}>\n                {children}\n              </code>\n            );\n          },\n        }}\n        remarkPlugins={[remarkGfm]}\n      >\n        {String(children)}\n      </MarkdownRender>\n    </div>\n  );\n}\n",
      "type": "registry:component"
    }
  ]
}