import React from "react"; import PageButton from "./PageButton"; type PageControlProps = { pageNumber: number; pageSize: number; total: number; }; const PageControl: React.FC = ({ pageNumber, pageSize, total, }) => { const totalPages = Math.max(1, Math.ceil(total / pageSize)); const isFirst = pageNumber === 1; const isLast = pageNumber === totalPages; return (
First {"<"} Page {pageNumber} of {totalPages} {">"} Last
); }; export default React.memo(PageControl);