import Pagination from "react-bootstrap/Pagination"; const ListPagination = (props) => { const { totalPages, page, setPage } = props; const handlePaginationItemClick = (event) => { const targetPage = Number(event.currentTarget.dataset.page); if (!isNaN(targetPage)) { setPage(targetPage); } }; return ( {page !== 1 ? : null} {Array.from({ length: totalPages }, (v, i) => i + 1).map(n => ( {n} ))} {page !== totalPages ? : null} ); }; export default ListPagination;