feat: standardize table pagination styling

This commit is contained in:
Esdras Renan 2025-10-20 21:05:50 -03:00
parent 50f6796ffa
commit 2e7f575682
3 changed files with 215 additions and 129 deletions

View file

@ -13,13 +13,7 @@ import {
useReactTable,
SortingState,
} from "@tanstack/react-table"
import {
IconChevronLeft,
IconChevronRight,
IconFilter,
IconTrash,
IconUser,
} from "@tabler/icons-react"
import { IconFilter, IconTrash, IconUser } from "@tabler/icons-react"
import { Badge } from "@/components/ui/badge"
import { Button } from "@/components/ui/button"
@ -49,6 +43,7 @@ import {
TableRow,
} from "@/components/ui/table"
import { Avatar, AvatarFallback } from "@/components/ui/avatar"
import { TablePagination } from "@/components/ui/table-pagination"
export type AdminClient = {
id: string
@ -386,29 +381,13 @@ export function AdminClientsManager({ initialClients }: { initialClients: AdminC
</Table>
</div>
<div className="flex flex-col items-center justify-between gap-3 text-sm text-neutral-600 md:flex-row">
<div>
Página {table.getState().pagination.pageIndex + 1} de {table.getPageCount() || 1}
</div>
<div className="flex items-center gap-2">
<Button
variant="outline"
size="icon"
onClick={() => table.previousPage()}
disabled={!table.getCanPreviousPage()}
>
<IconChevronLeft className="size-4" />
</Button>
<Button
variant="outline"
size="icon"
onClick={() => table.nextPage()}
disabled={!table.getCanNextPage()}
>
<IconChevronRight className="size-4" />
</Button>
</div>
</div>
<TablePagination
table={table}
pageSizeOptions={[10, 20, 30, 40, 50]}
rowsPerPageLabel="Itens por página"
showSelectedRows
selectionLabel={(selected, total) => `${selected} de ${total} selecionados`}
/>
</div>
<Dialog