import { useTranslation } from "@turbostarter/i18n"; import { cn } from "@turbostarter/ui"; import type { Table } from "@tanstack/react-table"; import { Button } from "#components/button"; import { Icons } from "#components/icons"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "#components/select"; interface DataTablePaginationProps extends React.ComponentProps<"div"> { table: Table; pageSizeOptions?: number[]; } export function DataTablePagination({ table, pageSizeOptions = [10, 20, 30, 40, 50], className, ...props }: DataTablePaginationProps) { const { t } = useTranslation("common"); return (
{table.options.enableRowSelection && (
{t("rowsSelected", { selected: table.getFilteredSelectedRowModel().rows.length, total: table.getFilteredRowModel().rows.length, })}
)}

{t("rowsPerPage")}

{t("pageOf", { page: table.getState().pagination.pageIndex + 1, total: table.getPageCount() || 1, })}
); }