import PaginationBoot from "./PaginationBoot"; const Pagination = ({ totalPages, activePage, prevPage, nextPage, paginate }) => { const pageWidth = 5 const section = Math.floor((activePage - 1) / pageWidth) let startPage = section * pageWidth + 1 if (startPage < 1) startPage = 1 let endPage = startPage + pageWidth - 1 if (endPage > totalPages) endPage = totalPages const pageNumbers = [] for (let i = startPage; i <= endPage; i++) { pageNumbers.push(i); } return ( paginate(1)} /> {pageNumbers.map((number, index) => { paginate(number); }} > {number} )} = totalPages} /> = totalPages} onClick={() => paginate(totalPages)} /> ) } export default Pagination