{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "data-table-pagination",
  "type": "registry:component",
  "title": "Data Table Pagination",
  "description": "Pagination controls used by the canonical M8 data table.",
  "dependencies": [
    "@tanstack/react-table",
    "lucide-react"
  ],
  "registryDependencies": [
    "button",
    "select"
  ],
  "files": [
    {
      "path": "registry/blocks/data-table/data-table-pagination.tsx",
      "content": "\"use client\";\n// astro-ui-m8-skin-version: 1.5.3 (A-C6 — run `npx astro-ui-m8-skin-lock` to compare against your installed @mano8/astro-ui-m8)\n\nimport type { Table } from \"@tanstack/react-table\";\nimport { ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight } from \"lucide-react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport {\n  Select,\n  SelectContent,\n  SelectItem,\n  SelectTrigger,\n  SelectValue,\n} from \"@/components/ui/select\";\n\nexport interface DataTablePaginationLabels {\n  selectedRows: (selected: number, total: number) => string;\n  rowsPerPage: string;\n  currentPage: (current: number, total: number) => string;\n  goToFirstPage: string;\n  goToPreviousPage: string;\n  goToNextPage: string;\n  goToLastPage: string;\n}\n\nconst DEFAULT_LABELS: DataTablePaginationLabels = {\n  selectedRows: (selected, total) => `${selected} of ${total} selected`,\n  rowsPerPage: \"Rows per page\",\n  currentPage: (current, total) => `Page ${current} of ${total}`,\n  goToFirstPage: \"Go to first page\",\n  goToPreviousPage: \"Go to previous page\",\n  goToNextPage: \"Go to next page\",\n  goToLastPage: \"Go to last page\",\n};\n\ninterface DataTablePaginationProps<TData> {\n  table: Table<TData>;\n  labels?: Partial<DataTablePaginationLabels>;\n  pageSizeOptions?: number[];\n}\n\nexport function DataTablePagination<TData>({\n  table,\n  labels,\n  pageSizeOptions = [10, 20, 30, 40, 50],\n}: DataTablePaginationProps<TData>) {\n  const t = { ...DEFAULT_LABELS, ...labels };\n  return (\n    <div className=\"flex flex-col gap-3 px-2 sm:flex-row sm:items-center sm:justify-between\">\n      <div className=\"flex-1 text-sm text-muted-foreground\">\n        {t.selectedRows(\n          table.getFilteredSelectedRowModel().rows.length,\n          table.getFilteredRowModel().rows.length,\n        )}\n      </div>\n      <div className=\"flex flex-wrap items-center gap-4 sm:gap-6 lg:gap-8\">\n        <div className=\"flex items-center space-x-2\">\n          <p className=\"text-sm font-medium\">{t.rowsPerPage}</p>\n          <Select\n            value={`${table.getState().pagination.pageSize}`}\n            onValueChange={(value) => table.setPageSize(Number(value))}\n          >\n            <SelectTrigger className=\"h-8 w-[70px]\">\n              <SelectValue placeholder={table.getState().pagination.pageSize} />\n            </SelectTrigger>\n            <SelectContent side=\"top\">\n              {pageSizeOptions.map((pageSize) => (\n                <SelectItem key={pageSize} value={`${pageSize}`}>\n                  {pageSize}\n                </SelectItem>\n              ))}\n            </SelectContent>\n          </Select>\n        </div>\n        <div className=\"flex w-[100px] items-center justify-center text-sm font-medium\">\n          {t.currentPage(table.getState().pagination.pageIndex + 1, table.getPageCount())}\n        </div>\n        <div className=\"flex items-center space-x-2\">\n          <Button\n            variant=\"outline\"\n            className=\"hidden size-8 p-0 lg:flex\"\n            onClick={() => table.setPageIndex(0)}\n            disabled={!table.getCanPreviousPage()}\n          >\n            <span className=\"sr-only\">{t.goToFirstPage}</span>\n            <ChevronsLeft className=\"size-4\" />\n          </Button>\n          <Button\n            variant=\"outline\"\n            className=\"size-8 p-0\"\n            onClick={() => table.previousPage()}\n            disabled={!table.getCanPreviousPage()}\n          >\n            <span className=\"sr-only\">{t.goToPreviousPage}</span>\n            <ChevronLeft className=\"size-4\" />\n          </Button>\n          <Button\n            variant=\"outline\"\n            className=\"size-8 p-0\"\n            onClick={() => table.nextPage()}\n            disabled={!table.getCanNextPage()}\n          >\n            <span className=\"sr-only\">{t.goToNextPage}</span>\n            <ChevronRight className=\"size-4\" />\n          </Button>\n          <Button\n            variant=\"outline\"\n            className=\"hidden size-8 p-0 lg:flex\"\n            onClick={() => table.setPageIndex(table.getPageCount() - 1)}\n            disabled={!table.getCanNextPage()}\n          >\n            <span className=\"sr-only\">{t.goToLastPage}</span>\n            <ChevronsRight className=\"size-4\" />\n          </Button>\n        </div>\n      </div>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/m8-ui/data-table-pagination.tsx"
    }
  ]
}
