import { PaginationState, Table } from '@tanstack/react-table'; import { Dispatch, SetStateAction } from 'react'; import { Button } from 'apps/frontend/src/components/ui/button'; export interface TablePaginationProps { rowsCount: number; pagination: PaginationState; setPagination: Dispatch> } export function TablePagination(props: TablePaginationProps) { const totalPages = Math.ceil(props.rowsCount / props.pagination.pageSize) const currentPage = props.pagination.pageIndex const isMonoPage = totalPages === 1 const hasNextPage = (props.pagination.pageIndex >= totalPages) const hasPreviousPage = !(props.pagination.pageIndex === 0) if (!props.rowsCount) return (<>); return (
{isMonoPage ? (

Il n'y as qu'une seule page.

) : (

Page {currentPage} sur {totalPages}

)}
) }