{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "comment-thread-fixtures",
  "title": "Comment Thread — fixtures",
  "author": "ilinxa",
  "description": "Comment Thread plus the dummy-data fixtures used by the docs-site demo.",
  "registryDependencies": [
    "@ilinxa/comment-thread"
  ],
  "files": [
    {
      "path": "src/registry/components/data/comment-thread/dummy-data.ts",
      "content": "import type {\n  Comment,\n  CommentDelta,\n  CommentThreadCurrentUser,\n  Subscribe,\n} from \"./types\";\n\nexport const DUMMY_VIEWER: CommentThreadCurrentUser = {\n  id: \"viewer-1\",\n  name: \"Sina Aytaç\",\n  avatar: \"https://images.unsplash.com/photo-1519085360753-af0119f7cbe7?w=200&h=200&fit=crop&crop=faces&q=80\",\n};\n\nconst NOW = new Date();\nconst minutesAgo = (n: number) => new Date(NOW.getTime() - n * 60 * 1000);\nconst hoursAgo = (n: number) => new Date(NOW.getTime() - n * 60 * 60 * 1000);\nconst daysAgo = (n: number) =>\n  new Date(NOW.getTime() - n * 24 * 60 * 60 * 1000);\n\nexport const DUMMY_FLAT_COMMENTS: Comment[] = [\n  {\n    id: \"c1\",\n    author: {\n      id: \"u1\",\n      name: \"Mira Solano\",\n      username: \"mira\",\n      avatar: \"https://images.unsplash.com/photo-1531123897727-8f129e1688ce?w=200&h=200&fit=crop&crop=faces&q=80\",\n    },\n    content:\n      \"This is exactly the kind of post I needed today. Saving for the weekend read.\",\n    createdAt: minutesAgo(2),\n    likes: 12,\n    isLiked: true,\n  },\n  {\n    id: \"c2\",\n    author: {\n      id: \"u2\",\n      name: \"Theo Zarrin\",\n      username: \"theoz\",\n      avatar: \"https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=200&h=200&fit=crop&crop=faces&q=80\",\n    },\n    content:\n      \"Hot take: most of what's framed as a system-design problem is actually a state-management problem dressed up. The boundaries we draw between services are usually load-bearing for our state model, not the other way around. Curious what others think about this — particularly in the context of the analytics-pipeline rewrite we shipped last quarter.\",\n    createdAt: minutesAgo(18),\n    likes: 47,\n  },\n  {\n    id: \"c3\",\n    author: {\n      id: \"u3\",\n      name: \"Ines Park\",\n      username: \"ines\",\n      avatar: \"https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=200&h=200&fit=crop&crop=faces&q=80\",\n    },\n    content:\n      \"Bookmarked. Thanks for sharing — fixed a typo here, the original phrasing was misleading.\",\n    createdAt: hoursAgo(2),\n    likes: 4,\n    edited: true,\n  },\n  {\n    id: \"c4\",\n    author: {\n      id: \"viewer-1\",\n      name: \"Sina Aytaç\",\n      username: \"sina\",\n      avatar: \"https://images.unsplash.com/photo-1519085360753-af0119f7cbe7?w=200&h=200&fit=crop&crop=faces&q=80\",\n    },\n    content: \"(my own comment — kebab shows Delete)\",\n    createdAt: hoursAgo(5),\n    likes: 0,\n  },\n  {\n    id: \"c5\",\n    author: {\n      id: \"u5\",\n      name: \"Lev Ortega\",\n      username: \"lev\",\n      avatar: \"https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=200&h=200&fit=crop&crop=faces&q=80\",\n    },\n    content: \"Following.\",\n    createdAt: daysAgo(1),\n    likes: 1,\n  },\n  {\n    id: \"c6\",\n    author: {\n      id: \"u6\",\n      name: \"Hana Sato\",\n      username: \"hana\",\n      avatar: \"https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=200&h=200&fit=crop&crop=faces&q=80\",\n    },\n    content:\n      \"I think I disagree with point 3 — but it depends on what you mean by 'eventual consistency' here. Are you describing the storage layer or the read model?\",\n    createdAt: daysAgo(3),\n    likes: 18,\n  },\n];\n\nexport const DUMMY_NESTED_DEPTH_2: Comment[] = [\n  {\n    id: \"n1\",\n    author: {\n      id: \"u1\",\n      name: \"Mira Solano\",\n      username: \"mira\",\n      avatar: \"https://images.unsplash.com/photo-1531123897727-8f129e1688ce?w=200&h=200&fit=crop&crop=faces&q=80\",\n    },\n    content: \"Where does this leave the migration plan from Q2?\",\n    createdAt: minutesAgo(20),\n    likes: 8,\n    replies: [\n      {\n        id: \"n1r1\",\n        author: {\n          id: \"u2\",\n          name: \"Theo Zarrin\",\n          username: \"theoz\",\n          avatar: \"https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=200&h=200&fit=crop&crop=faces&q=80\",\n        },\n        content:\n          \"Q2 plan still holds — the rewrite slots underneath without changing the user-facing contracts. We just don't get to delete the old code path until Q3.\",\n        createdAt: minutesAgo(15),\n        likes: 11,\n        replies: [\n          {\n            id: \"n1r1r1\",\n            author: {\n              id: \"u3\",\n              name: \"Ines Park\",\n              username: \"ines\",\n              avatar: \"https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=200&h=200&fit=crop&crop=faces&q=80\",\n            },\n            content: \"Ack, that tracks.\",\n            createdAt: minutesAgo(8),\n            likes: 2,\n          },\n        ],\n      },\n      {\n        id: \"n1r2\",\n        author: {\n          id: \"u4\",\n          name: \"Renee Bishop\",\n          username: \"renee\",\n          avatar: \"https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=200&h=200&fit=crop&crop=faces&q=80\",\n        },\n        content: \"Linking the migration doc here would help newcomers.\",\n        createdAt: minutesAgo(3),\n        likes: 0,\n      },\n    ],\n  },\n  {\n    id: \"n2\",\n    author: {\n      id: \"u5\",\n      name: \"Lev Ortega\",\n      username: \"lev\",\n      avatar: \"https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=200&h=200&fit=crop&crop=faces&q=80\",\n    },\n    content: \"Solid breakdown.\",\n    createdAt: hoursAgo(1),\n    likes: 3,\n  },\n];\n\nexport const DUMMY_NESTED_DEPTH_3: Comment[] = [\n  {\n    id: \"d1\",\n    author: {\n      id: \"u1\",\n      name: \"Mira Solano\",\n      username: \"mira\",\n      avatar: \"https://images.unsplash.com/photo-1531123897727-8f129e1688ce?w=200&h=200&fit=crop&crop=faces&q=80\",\n    },\n    content: \"Top-level question.\",\n    createdAt: minutesAgo(30),\n    likes: 5,\n    replies: [\n      {\n        id: \"d1r1\",\n        author: {\n          id: \"u2\",\n          name: \"Theo Zarrin\",\n          username: \"theoz\",\n          avatar: \"https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=200&h=200&fit=crop&crop=faces&q=80\",\n        },\n        content: \"Depth-1 answer.\",\n        createdAt: minutesAgo(20),\n        likes: 3,\n        replies: [\n          {\n            id: \"d1r1r1\",\n            author: {\n              id: \"u3\",\n              name: \"Ines Park\",\n              username: \"ines\",\n              avatar: \"https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=200&h=200&fit=crop&crop=faces&q=80\",\n            },\n            content: \"Depth-2 follow-up — past initial maxDepth.\",\n            createdAt: minutesAgo(10),\n            likes: 1,\n            replies: [\n              {\n                id: \"d1r1r1r1\",\n                author: {\n                  id: \"u4\",\n                  name: \"Renee Bishop\",\n                  username: \"renee\",\n                  avatar: \"https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=200&h=200&fit=crop&crop=faces&q=80\",\n                },\n                content:\n                  \"Depth-3 deep dive — only visible after expanding 'view N replies'.\",\n                createdAt: minutesAgo(5),\n                likes: 0,\n              },\n            ],\n          },\n        ],\n      },\n    ],\n  },\n];\n\nconst ROTATING_AVATARS = [\n  \"https://images.unsplash.com/photo-1531123897727-8f129e1688ce?w=200&h=200&fit=crop&crop=faces&q=80\",\n  \"https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=200&h=200&fit=crop&crop=faces&q=80\",\n  \"https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=200&h=200&fit=crop&crop=faces&q=80\",\n  \"https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=200&h=200&fit=crop&crop=faces&q=80\",\n  \"https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=200&h=200&fit=crop&crop=faces&q=80\",\n];\n\nexport const DUMMY_LARGE_THREAD: Comment[] = Array.from(\n  { length: 10 },\n  (_, i) => ({\n    id: `large-${i}`,\n    author: {\n      id: `u${(i % 5) + 1}`,\n      name: [\n        \"Mira Solano\",\n        \"Theo Zarrin\",\n        \"Ines Park\",\n        \"Renee Bishop\",\n        \"Lev Ortega\",\n      ][i % 5],\n      username: [\"mira\", \"theoz\", \"ines\", \"renee\", \"lev\"][i % 5],\n      avatar: ROTATING_AVATARS[i % ROTATING_AVATARS.length],\n    },\n    content: `Comment ${i + 1} on this thread. The pageSize lock means only the first 10 render, with a \"Load older comments\" button beneath.`,\n    createdAt: hoursAgo(i + 1),\n    likes: (i * 7) % 20,\n  }),\n);\n\nexport function generateOlderPage(page: number): Comment[] {\n  const offset = (page - 1) * 10;\n  return Array.from({ length: 10 }, (_, i) => ({\n    id: `older-${offset + i}`,\n    author: {\n      id: `u${(i % 5) + 1}`,\n      name: [\n        \"Mira Solano\",\n        \"Theo Zarrin\",\n        \"Ines Park\",\n        \"Renee Bishop\",\n        \"Lev Ortega\",\n      ][i % 5],\n      username: [\"mira\", \"theoz\", \"ines\", \"renee\", \"lev\"][i % 5],\n      avatar: ROTATING_AVATARS[i % ROTATING_AVATARS.length],\n    },\n    content: `Older comment from page ${page}, slot ${i + 1}.`,\n    createdAt: daysAgo(page * 7 + i),\n    likes: (i * 3) % 8,\n  }));\n}\n\nconst LIVE_AVATARS = [\n  \"https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=200&h=200&fit=crop&crop=faces&q=80\",\n  \"https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=200&h=200&fit=crop&crop=faces&q=80\",\n  \"https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=200&h=200&fit=crop&crop=faces&q=80\",\n  \"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=200&h=200&fit=crop&crop=faces&q=80\",\n  \"https://images.unsplash.com/photo-1544005313-94ddf0286df2?w=200&h=200&fit=crop&crop=faces&q=80\",\n  \"https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=200&h=200&fit=crop&crop=faces&q=80\",\n  \"https://images.unsplash.com/photo-1502685104226-ee32379fefbe?w=200&h=200&fit=crop&crop=faces&q=80\",\n  \"https://images.unsplash.com/photo-1531123897727-8f129e1688ce?w=200&h=200&fit=crop&crop=faces&q=80\",\n];\n\n/** Sandbox-only fake subscribe — synthetic deltas every 6s for showcase. */\nexport function createDummySubscribe(): Subscribe<CommentDelta> {\n  return (handler) => {\n    let tick = 0;\n    const id = setInterval(() => {\n      tick++;\n      const variant = tick % 3;\n      if (variant === 0) {\n        handler({\n          kind: \"added\",\n          comment: {\n            id: `live-${Date.now()}`,\n            author: {\n              id: `live-user-${tick}`,\n              name: `Live User ${tick}`,\n              username: `live${tick}`,\n              avatar: LIVE_AVATARS[tick % LIVE_AVATARS.length],\n            },\n            content: `Live-arriving comment #${tick}.`,\n            createdAt: new Date(),\n            likes: 0,\n          },\n        });\n      } else if (variant === 1) {\n        handler({\n          kind: \"liked\",\n          commentId: \"c1\",\n          liked: true,\n          count: 12 + tick,\n        });\n      } else {\n        handler({\n          kind: \"edited\",\n          commentId: \"c2\",\n          content: `(edited live, tick ${tick})`,\n        });\n      }\n    }, 6000);\n    return () => clearInterval(id);\n  };\n}\n",
      "type": "registry:component",
      "target": "components/comment-thread/dummy-data.ts"
    }
  ],
  "categories": [
    "data",
    "fixtures"
  ],
  "type": "registry:block"
}