{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "blog-09",
  "type": "registry:block",
  "description": "Author selector grid of initials avatars that filters the post list below by writer.",
  "dependencies": [],
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/designali/blocks/blog/blog-09.tsx",
      "content": "\"use client\"\n\nimport { useState } from \"react\"\n\nimport { cn } from \"@workspace/ui/lib/utils\"\n\nconst authors = [\n  { id: \"nk\", name: \"Ali Imam\", role: \"Founder & design engineer\", initials: \"AI\", tone: \"bg-chart-1\" },\n  { id: \"bo\", name: \"Studio Designer\", role: \"UI/UX design\", initials: \"SD\", tone: \"bg-chart-2\" },\n  { id: \"ml\", name: \"Studio Developer\", role: \"Next.js development\", initials: \"DV\", tone: \"bg-chart-3\" },\n  { id: \"rv\", name: \"Motion Artist\", role: \"CGI, 3D & motion\", initials: \"MA\", tone: \"bg-chart-4\" },\n]\n\nconst posts = [\n  { author: \"nk\", title: \"Incremental builds for the Designali monorepo\", date: \"Nov 12\", read: 13 },\n  { author: \"bo\", title: \"Designing a landing page that sells templates\", date: \"Nov 10\", read: 5 },\n  { author: \"ml\", title: \"Server components for the /blocks registry\", date: \"Nov 4\", read: 10 },\n  { author: \"rv\", title: \"Rendering Apple device mockups in 3D\", date: \"Oct 30\", read: 6 },\n  { author: \"nk\", title: \"Design se code tak, in practice\", date: \"Oct 22\", read: 8 },\n  { author: \"bo\", title: \"A color system with exactly eleven tokens\", date: \"Oct 16\", read: 7 },\n  { author: \"ml\", title: \"Typed registry JSON with TypeScript\", date: \"Oct 9\", read: 9 },\n  { author: \"rv\", title: \"Motion design for the Designali brand\", date: \"Oct 1\", read: 4 },\n]\n\nexport default function Blog09() {\n  const [selected, setSelected] = useState<string | null>(null)\n  const visible = selected ? posts.filter((p) => p.author === selected) : posts\n\n  return (\n    <section className=\"w-full bg-background py-16 text-foreground md:py-24\">\n      <div className=\"mx-auto max-w-7xl px-6\">\n        <div className=\"text-center\">\n          <h2 className=\"text-3xl font-medium tracking-tight md:text-4xl\">Written by the people who build Designali</h2>\n          <p className=\"mt-3 text-muted-foreground\">Pick a writer to see only their posts.</p>\n        </div>\n\n        <div className=\"mt-10 grid grid-cols-2 gap-3 md:grid-cols-4\">\n          {authors.map((a) => {\n            const on = selected === a.id\n            const count = posts.filter((p) => p.author === a.id).length\n            return (\n              <button\n                key={a.id}\n                type=\"button\"\n                aria-pressed={on}\n                onClick={() => setSelected(on ? null : a.id)}\n                className={cn(\n                  \"flex flex-col items-center border p-5 text-center transition-colors\",\n                  on ? \"border-foreground bg-muted\" : \"hover:bg-muted/50\",\n                  selected && !on && \"opacity-50\"\n                )}\n              >\n                <span\n                  className={cn(\n                    \"flex size-14 items-center justify-center rounded-full text-sm font-semibold text-background\",\n                    a.tone\n                  )}\n                >\n                  {a.initials}\n                </span>\n                <span className=\"mt-3 text-sm font-medium\">{a.name}</span>\n                <span className=\"text-xs text-muted-foreground\">{a.role}</span>\n                <span className=\"mt-2 text-[10px] text-muted-foreground\">{count} posts</span>\n              </button>\n            )\n          })}\n        </div>\n\n        <ul className=\"mx-auto mt-12 max-w-3xl divide-y border-y\">\n          {visible.map((post) => {\n            const author = authors.find((a) => a.id === post.author)\n            return (\n              <li key={post.title}>\n                <a href=\"#\" className=\"group flex items-center gap-4 py-5\">\n                  <span\n                    className={cn(\n                      \"flex size-8 shrink-0 items-center justify-center rounded-full text-[10px] font-semibold text-background\",\n                      author?.tone\n                    )}\n                  >\n                    {author?.initials}\n                  </span>\n                  <span className=\"min-w-0 flex-1\">\n                    <span className=\"block font-medium group-hover:underline group-hover:underline-offset-4\">\n                      {post.title}\n                    </span>\n                    <span className=\"text-xs text-muted-foreground\">\n                      {author?.name} · {post.date}\n                    </span>\n                  </span>\n                  <span className=\"hidden text-xs text-muted-foreground sm:block\">{post.read} min</span>\n                </a>\n              </li>\n            )\n          })}\n        </ul>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "meta": {
    "iframeHeight": "950px"
  },
  "categories": [
    "blog"
  ]
}