import { useIsLoading } from "@/contexts"; import { Group, Pagination, Text } from "@mantine/core"; import { FunctionComponent } from "react"; interface Props { count: number; index: number; size: number; total: number; goto: (idx: number) => void; } const PageControl: FunctionComponent = ({ count, index, size, total, goto, }) => { const empty = total === 0; const start = empty ? 0 : size * index + 1; const end = Math.min(size * (index + 1), total); const isLoading = useIsLoading(); return ( Show {start} to {end} of {total} entries goto(page - 1)} hidden={count <= 1} total={count} > ); }; export default PageControl;