import type { Table } from '@tanstack/react-table' import { ActionIcon, Group, Select, Text } from '@mantine/core' import { IconChevronLeft, IconChevronRight, IconChevronsLeft, IconChevronsRight } from '@tabler/icons-react' import styles from '../../styles/griddy.module.css' interface PaginationControlProps { pageSizeOptions?: number[] table: Table } export function PaginationControl({ pageSizeOptions = [10, 25, 50, 100], table }: PaginationControlProps) { const pageIndex = table.getState().pagination.pageIndex const pageSize = table.getState().pagination.pageSize const pageCount = table.getPageCount() const canPreviousPage = table.getCanPreviousPage() const canNextPage = table.getCanNextPage() return ( Page {pageIndex + 1} of {pageCount} table.setPageIndex(0)} size="sm" variant="subtle" > table.previousPage()} size="sm" variant="subtle" > table.nextPage()} size="sm" variant="subtle" > table.setPageIndex(pageCount - 1)} size="sm" variant="subtle" > Rows per page: