{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "blog-18",
  "type": "registry:block",
  "description": "Three-column story grid with client-side numbered pagination and newer and older controls.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/designali/blocks/blog/blog-18.tsx",
      "content": "\"use client\"\n\nimport { useState } from \"react\"\nimport {\n  ChevronLeft,\n  ChevronRight,\n} from \"@designali/icons\"\n\nimport { cn } from \"@workspace/ui/lib/utils\"\n\nconst posts = [\n  { title: \"A design school for people who hate tutorials\", cat: \"Design\", date: \"Nov 14\", image: \"/img/ask/ask1.jpg\" },\n  { title: \"Twelve hours inside a Figma file\", cat: \"Code\", date: \"Nov 12\", image: \"/img/ask/ask2.jpg\" },\n  { title: \"Inside the Dalim Fonts archive\", cat: \"Craft\", date: \"Nov 9\", image: \"/images/templates/dalim-fonts-old.jpg\" },\n  { title: \"Running a template store with four products\", cat: \"Business\", date: \"Nov 7\", image: \"/images/templates/resort.jpg\" },\n  { title: \"The designers who ship at 2am\", cat: \"Design\", date: \"Nov 4\", image: \"/img/ask/ask5.jpg\" },\n  { title: \"Redrawing icons as a weekly ritual\", cat: \"Craft\", date: \"Nov 1\", image: \"/images/templates/dalim-icons-old.jpg\" },\n  { title: \"A walking guide to the Designali work page\", cat: \"Code\", date: \"Oct 29\", image: \"/images/templates/dalim-works-old.jpg\" },\n  { title: \"What a template sells in its first week\", cat: \"Business\", date: \"Oct 26\", image: \"/images/templates/portfolio-simple.jpg\" },\n  { title: \"Motion design for the impatient\", cat: \"Design\", date: \"Oct 22\", image: \"/img/ask/ask7.jpg\" },\n  { title: \"Sketchbooks of a design engineer\", cat: \"Craft\", date: \"Oct 19\", image: \"/img/ask/ask9.jpg\" },\n  { title: \"Weekend projects you can build with blocks\", cat: \"Code\", date: \"Oct 15\", image: \"/images/templates/vercel.jpg\" },\n  { title: \"The economics of a one-person studio\", cat: \"Business\", date: \"Oct 12\", image: \"/stock/strategy.jpg\" },\n]\n\nconst perPage = 6\n\nexport default function Blog18() {\n  const [page, setPage] = useState(1)\n  const pages = Math.ceil(posts.length / perPage)\n  const visible = posts.slice((page - 1) * perPage, page * perPage)\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=\"flex flex-col gap-2 sm:flex-row sm:items-end sm:justify-between\">\n          <h2 className=\"font-sans text-4xl tracking-tight\">Designali magazine</h2>\n          <p className=\"text-sm text-muted-foreground\">\n            Showing {(page - 1) * perPage + 1}–{Math.min(page * perPage, posts.length)} of {posts.length} stories\n          </p>\n        </div>\n\n        <div className=\"mt-10 grid gap-x-6 gap-y-10 sm:grid-cols-2 lg:grid-cols-3\">\n          {visible.map((p) => (\n            <a key={p.title} href=\"#\" className=\"group\">\n              <div className=\"aspect-[3/2] overflow-hidden border bg-muted\">\n                <img\n                  src={p.image}\n                  alt=\"\"\n                  className=\"size-full object-cover transition-transform duration-500 group-hover:scale-105\"\n                />\n              </div>\n              <div className=\"mt-4 flex items-center gap-2 text-xs text-muted-foreground\">\n                <span className=\"font-medium text-foreground\">{p.cat}</span>\n                <span>·</span>\n                <span>{p.date}</span>\n              </div>\n              <h3 className=\"mt-2 text-lg leading-snug font-medium group-hover:underline group-hover:underline-offset-4\">\n                {p.title}\n              </h3>\n            </a>\n          ))}\n        </div>\n\n        <nav aria-label=\"Pagination\" className=\"mt-14 flex items-center justify-between border-t pt-6\">\n          <button\n            type=\"button\"\n            onClick={() => setPage((p) => Math.max(1, p - 1))}\n            disabled={page === 1}\n            className=\"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground disabled:pointer-events-none disabled:opacity-40\"\n          >\n            <ChevronLeft className=\"size-4\" />\n            Newer\n          </button>\n          <div className=\"flex gap-1\">\n            {Array.from({ length: pages }, (_, i) => i + 1).map((n) => (\n              <button\n                key={n}\n                type=\"button\"\n                onClick={() => setPage(n)}\n                aria-current={n === page ? \"page\" : undefined}\n                className={cn(\n                  \"size-9 text-sm transition-colors\",\n                  n === page ? \"bg-foreground text-background\" : \"hover:bg-muted\"\n                )}\n              >\n                {n}\n              </button>\n            ))}\n          </div>\n          <button\n            type=\"button\"\n            onClick={() => setPage((p) => Math.min(pages, p + 1))}\n            disabled={page === pages}\n            className=\"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground disabled:pointer-events-none disabled:opacity-40\"\n          >\n            Older\n            <ChevronRight className=\"size-4\" />\n          </button>\n        </nav>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "meta": {
    "iframeHeight": "1000px"
  },
  "categories": [
    "blog"
  ]
}