{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "collapsible5",
  "title": "Collapsible",
  "description": "Collapsible built with shadcn/ui.",
  "dependencies": [
    "lucide-react@0"
  ],
  "registryDependencies": [
    "avatar",
    "badge",
    "button",
    "collapsible"
  ],
  "files": [
    {
      "path": "contents/components/collapsible/5/index.tsx",
      "content": "\"use client\";\n\nimport { useState } from \"react\";\nimport { ChevronDownIcon, MessageSquareIcon } from \"lucide-react\";\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger } from \"@/components/ui/collapsible\";\nimport { Button } from \"@/components/ui/button\";\nimport { Avatar, AvatarFallback, AvatarImage } from \"@/components/ui/avatar\";\nimport { Badge } from \"@/components/ui/badge\";\n\nconst comments = [\n  {\n    id: 1,\n    author: \"John Doe\",\n    avatar: \"https://i.pravatar.cc/150?img=1\",\n    time: \"2 hours ago\",\n    content: \"This is an amazing feature! Great work on the implementation.\",\n    replies: [\n      {\n        id: 11,\n        author: \"Sarah Miller\",\n        avatar: \"https://i.pravatar.cc/150?img=2\",\n        time: \"1 hour ago\",\n        content: \"I completely agree! The design is fantastic.\"\n      },\n      {\n        id: 12,\n        author: \"Mike Johnson\",\n        avatar: \"https://i.pravatar.cc/150?img=3\",\n        time: \"45 min ago\",\n        content: \"Thanks for sharing this. Very helpful!\"\n      }\n    ]\n  },\n  {\n    id: 2,\n    author: \"Emma Wilson\",\n    avatar: \"https://i.pravatar.cc/150?img=4\",\n    time: \"3 hours ago\",\n    content: \"I have a question about how this works. Can someone explain?\",\n    replies: [\n      {\n        id: 21,\n        author: \"David Brown\",\n        avatar: \"https://i.pravatar.cc/150?img=5\",\n        time: \"2 hours ago\",\n        content: \"Sure! It works by...\"\n      }\n    ]\n  }\n];\n\nfunction CommentItem({ comment }: { comment: (typeof comments)[0] }) {\n  const [isOpen, setIsOpen] = useState(false);\n\n  return (\n    <div className=\"space-y-3 rounded-lg border p-4\">\n      <div className=\"flex items-start gap-3\">\n        <Avatar>\n          <AvatarImage src={comment.avatar} alt={comment.author} />\n          <AvatarFallback>\n            {comment.author\n              .split(\" \")\n              .map((n) => n[0])\n              .join(\"\")}\n          </AvatarFallback>\n        </Avatar>\n        <div className=\"flex-1 space-y-1\">\n          <div className=\"flex items-center gap-2\">\n            <span className=\"text-sm font-semibold\">{comment.author}</span>\n            <span className=\"text-muted-foreground text-xs\">{comment.time}</span>\n          </div>\n          <p className=\"text-sm\">{comment.content}</p>\n          {comment.replies.length > 0 && (\n            <Collapsible open={isOpen} onOpenChange={setIsOpen}>\n              <CollapsibleTrigger asChild>\n                <Button variant=\"ghost\" size=\"sm\" className=\"h-7 gap-2\">\n                  <MessageSquareIcon className=\"h-3 w-3\" />\n                  <span className=\"text-xs\">\n                    {comment.replies.length} {comment.replies.length === 1 ? \"comment\" : \"comments\"}\n                  </span>\n                  <ChevronDownIcon\n                    className={`h-3 w-3 transition-transform duration-200 ${isOpen ? \"rotate-180\" : \"\"}`}\n                  />\n                </Button>\n              </CollapsibleTrigger>\n              <CollapsibleContent className=\"space-y-3 pt-2\">\n                {comment.replies.map((reply) => (\n                  <div key={reply.id} className=\"flex items-start gap-3 pl-6\">\n                    <Avatar className=\"size-8\">\n                      <AvatarImage src={reply.avatar} alt={reply.author} />\n                      <AvatarFallback>\n                        {reply.author\n                          .split(\" \")\n                          .map((n) => n[0])\n                          .join(\"\")}\n                      </AvatarFallback>\n                    </Avatar>\n                    <div className=\"flex-1 space-y-1\">\n                      <div className=\"flex items-center gap-2\">\n                        <span className=\"text-sm font-semibold\">{reply.author}</span>\n                        <span className=\"text-muted-foreground text-xs\">{reply.time}</span>\n                      </div>\n                      <p className=\"text-sm\">{reply.content}</p>\n                    </div>\n                  </div>\n                ))}\n              </CollapsibleContent>\n            </Collapsible>\n          )}\n        </div>\n      </div>\n    </div>\n  );\n}\n\nexport default function CollapsibleComponent() {\n  return (\n    <div className=\"w-full max-w-2xl space-y-4\">\n      {comments.map((comment) => (\n        <CommentItem key={comment.id} comment={comment} />\n      ))}\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/collapsible5.tsx"
    }
  ],
  "type": "registry:component"
}