{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "blog-10",
  "type": "registry:block",
  "description": "Sidebar search input and topic chips that live-filter a list of engineering posts with result count and empty state.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "input"
  ],
  "files": [
    {
      "path": "registry/designali/blocks/blog/blog-10.tsx",
      "content": "\"use client\"\n\nimport { useState } from \"react\"\nimport {\n  Search,\n  X,\n} from \"@designali/icons\"\n\nimport { Input } from \"@workspace/ui/components/input\"\nimport { cn } from \"@workspace/ui/lib/utils\"\n\nconst posts = [\n  { title: \"Migrating 460 blocks to a new registry\", tags: [\"Registry\", \"Migrations\"], excerpt: \"Codemods, backfills, and the checklist we now use for every block change.\" },\n  { title: \"Serving icons from the edge on Vercel\", tags: [\"Edge\", \"Performance\"], excerpt: \"How designali.com serves 4,000+ SVG icons in under a millisecond.\" },\n  { title: \"Choosing a checkout for Designali templates\", tags: [\"Billing\", \"Architecture\"], excerpt: \"When a simple payment link is fine and when you need more.\" },\n  { title: \"Typed registry items without codegen\", tags: [\"Registry\", \"TypeScript\"], excerpt: \"Keeping 2,300+ UI examples type-safe and readable.\" },\n  { title: \"Observability for a small studio\", tags: [\"Monitoring\", \"Architecture\"], excerpt: \"The five dashboards we actually open, and the forty we deleted.\" },\n  { title: \"Speeding up the Designali monorepo CI\", tags: [\"CI\", \"Performance\"], excerpt: \"From 19 minutes to 4 on every pull request.\" },\n  { title: \"Designing idempotent license webhooks\", tags: [\"Billing\", \"Edge\"], excerpt: \"Retries are guaranteed. Duplicate charges should not be.\" },\n]\n\nconst allTags = Array.from(new Set(posts.flatMap((p) => p.tags))).sort()\n\nexport default function Blog10() {\n  const [query, setQuery] = useState(\"\")\n  const [tag, setTag] = useState<string | null>(null)\n\n  const q = query.trim().toLowerCase()\n  const results = posts.filter(\n    (p) =>\n      (!tag || p.tags.includes(tag)) &&\n      (!q || p.title.toLowerCase().includes(q) || p.excerpt.toLowerCase().includes(q))\n  )\n\n  return (\n    <section className=\"w-full bg-muted/40 py-16 text-foreground md:py-24\">\n      <div className=\"mx-auto grid max-w-7xl gap-10 px-6 lg:grid-cols-[280px_1fr]\">\n        <aside className=\"lg:sticky lg:top-24 lg:self-start\">\n          <h2 className=\"text-2xl font-medium tracking-tight\">Engineering notes</h2>\n          <p className=\"mt-2 text-sm text-muted-foreground\">Search the Designali engineering blog.</p>\n          <div className=\"relative mt-6\">\n            <Search className=\"pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground\" />\n            <Input\n              value={query}\n              onChange={(e) => setQuery(e.target.value)}\n              placeholder=\"Search posts\"\n              aria-label=\"Search posts\"\n              className=\"h-10 bg-background pl-9\"\n            />\n          </div>\n          <p className=\"mt-8 text-xs tracking-widest text-muted-foreground uppercase\">Topics</p>\n          <div className=\"mt-3 flex flex-wrap gap-2\">\n            {allTags.map((t) => (\n              <button\n                key={t}\n                type=\"button\"\n                onClick={() => setTag(tag === t ? null : t)}\n                aria-pressed={tag === t}\n                className={cn(\n                  \"border px-2.5 py-1 text-xs transition-colors\",\n                  tag === t\n                    ? \"border-foreground bg-foreground text-background\"\n                    : \"bg-background hover:bg-muted\"\n                )}\n              >\n                {t}\n              </button>\n            ))}\n          </div>\n        </aside>\n\n        <div>\n          <div className=\"flex items-center justify-between border-b pb-3 text-sm\">\n            <span className=\"text-muted-foreground\">\n              {results.length} {results.length === 1 ? \"result\" : \"results\"}\n              {tag ? ` in ${tag}` : \"\"}\n            </span>\n            {(tag || q) && (\n              <button\n                type=\"button\"\n                onClick={() => {\n                  setTag(null)\n                  setQuery(\"\")\n                }}\n                className=\"inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground\"\n              >\n                <X className=\"size-3\" />\n                Clear filters\n              </button>\n            )}\n          </div>\n\n          {results.length === 0 ? (\n            <div className=\"border-b py-16 text-center text-sm text-muted-foreground\">\n              No posts match &ldquo;{query}&rdquo;. Try a broader term.\n            </div>\n          ) : (\n            <ul className=\"divide-y border-b\">\n              {results.map((p) => (\n                <li key={p.title}>\n                  <a href=\"#\" className=\"group block py-6\">\n                    <h3 className=\"text-lg font-medium group-hover:underline group-hover:underline-offset-4\">\n                      {p.title}\n                    </h3>\n                    <p className=\"mt-1 text-sm text-muted-foreground\">{p.excerpt}</p>\n                    <div className=\"mt-3 flex gap-2\">\n                      {p.tags.map((t) => (\n                        <span key={t} className=\"bg-background px-2 py-0.5 font-sans text-[10px] text-muted-foreground\">\n                          #{t.toLowerCase()}\n                        </span>\n                      ))}\n                    </div>\n                  </a>\n                </li>\n              ))}\n            </ul>\n          )}\n        </div>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "meta": {
    "iframeHeight": "850px"
  },
  "categories": [
    "blog"
  ]
}