{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "comment-thread", "type": "registry:ui", "title": "Comment Thread", "description": "Threaded comment component with nested replies, colored avatars, and collapsible reply chains.", "registryDependencies": [ "accordion" ], "files": [ { "path": "registry/ruixenui/comment-thread.tsx", "content": "\"use client\";\n\nimport * as React from \"react\";\nimport {\n Accordion,\n AccordionContent,\n AccordionItem,\n AccordionTrigger,\n} from \"@/components/ui/accordion\";\nimport { cn } from \"@/lib/utils\";\n\nfunction CommentThread({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction Comment({\n className,\n ...props\n}: React.ComponentProps) {\n return (\n \n );\n}\n\nfunction CommentAvatar({\n name,\n src,\n className,\n color,\n}: {\n name: string;\n src?: string;\n className?: string;\n color?: string;\n}) {\n const initials = name\n .split(\" \")\n .map((n) => n[0])\n .join(\"\")\n .slice(0, 2)\n .toUpperCase();\n\n return (\n \n {src ? (\n {name}\n ) : (\n initials\n )}\n \n );\n}\n\nfunction CommentHeader({\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n \n {children}\n \n );\n}\n\nfunction CommentBody({\n className,\n children,\n ...props\n}: React.ComponentProps<\"p\">) {\n return (\n \n {children}\n

\n );\n}\n\nfunction CommentToggle({\n className,\n children,\n ...props\n}: React.ComponentProps) {\n return (\n svg]:hidden\",\n className,\n )}\n {...props}\n >\n {children ?? \"Show Replies\"}\n \n );\n}\n\nfunction CommentReplies({\n className,\n children,\n ...props\n}: React.ComponentProps) {\n return (\n \n {children}\n \n );\n}\n\nexport {\n CommentThread,\n Comment,\n CommentAvatar,\n CommentHeader,\n CommentBody,\n CommentToggle,\n CommentReplies,\n};\n", "type": "registry:ui", "target": "components/ruixen/comment-thread.tsx" } ] }