{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "use-pagination-demo",
  "title": "UsePaginationDemo",
  "description": "use-pagination's hook in action.",
  "registryDependencies": [
    "card",
    "button",
    "https://guarahooks.com/r/use-pagination.json"
  ],
  "files": [
    {
      "path": "registry/example/use-pagination-demo.tsx",
      "content": "'use client';\n\nimport React from 'react';\n\nimport { Button } from '@/components/ui/button';\nimport {\n  Card,\n  CardContent,\n  CardDescription,\n  CardFooter,\n  CardHeader,\n  CardTitle,\n} from '@/components/ui/card';\n\nimport { usePagination } from '@/hooks/guarahooks/use-pagination';\n\nexport default function UsePaginationDemo() {\n  const totalItems = 100;\n  const {\n    page,\n    pageSize,\n    totalPages,\n    setPage,\n    nextPage,\n    prevPage,\n    setPageSize,\n  } = usePagination(totalItems, { initialPage: 1, initialPageSize: 10 });\n\n  return (\n    <Card className=\"relative max-w-sm w-full\">\n      <CardHeader>\n        <CardTitle>usePagination</CardTitle>\n        <CardDescription>\n          Example of pagination using the <code>usePagination</code> hook.\n        </CardDescription>\n      </CardHeader>\n\n      <CardContent>\n        <p>\n          Page: <strong>{page}</strong> of <strong>{totalPages}</strong>\n        </p>\n        <p>\n          Items per page: <strong>{pageSize}</strong>\n        </p>\n      </CardContent>\n\n      <CardFooter className=\"flex flex-wrap gap-2\">\n        <Button onClick={() => setPageSize(5)}>5 / page</Button>\n        <Button onClick={() => setPageSize(10)}>10 / page</Button>\n        <Button onClick={() => setPageSize(20)}>20 / page</Button>\n        <Button onClick={prevPage} disabled={page <= 1}>\n          Previous\n        </Button>\n        <Button onClick={nextPage} disabled={page >= totalPages}>\n          Next\n        </Button>\n      </CardFooter>\n    </Card>\n  );\n}\n",
      "type": "registry:example",
      "target": "components/example/use-pagination-demo.tsx"
    }
  ],
  "type": "registry:example"
}