import { ChevronLeftIcon, ChevronRightIcon, DoubleArrowLeftIcon, DoubleArrowRightIcon, } from '@radix-ui/react-icons' import { type Table } from '@tanstack/react-table' import { useTranslation } from 'react-i18next' import { cn, getPageNumbers } from '@/lib/utils' import { Button } from '@/components/ui/button' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '@/components/ui/select' type DataTablePaginationProps = { table: Table } export function DataTablePagination({ table, }: DataTablePaginationProps) { const { t } = useTranslation() const currentPage = table.getState().pagination.pageIndex + 1 const totalPages = table.getPageCount() const pageNumbers = getPageNumbers(currentPage, totalPages) return (
{t('Page {{current}} of {{total}}', { current: currentPage, total: totalPages, })}

{t('Rows per page')}

{t('Page {{current}} of {{total}}', { current: currentPage, total: totalPages, })}
{/* Page number buttons */} {pageNumbers.map((pageNumber, index) => (
{pageNumber === '...' ? ( ... ) : ( )}
))}
) }