import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import { Pagination, PaginationItem, PaginationLink } from 'reactstrap'; import { isPageDisabled, keyForPage, progressivePagination } from '../utils/helpers/pagination'; import './SimplePaginator.scss'; const propTypes = { pagesCount: PropTypes.number.isRequired, currentPage: PropTypes.number.isRequired, setCurrentPage: PropTypes.func.isRequired, centered: PropTypes.bool, }; const SimplePaginator = ({ pagesCount, currentPage, setCurrentPage, centered = true }) => { if (pagesCount < 2) { return null; } const onClick = (page) => () => setCurrentPage(page); return ( {progressivePagination(currentPage, pagesCount).map((pageNumber, index) => ( {pageNumber} ))} = pagesCount}> ); }; SimplePaginator.propTypes = propTypes; export default SimplePaginator;