芝麻web文件管理V1.00
编辑当前文件:/home/royashxg/www/wp-content/plugins/envato-elements/src/js/react/components/Search/Pagination.jsx
import React from 'react' import ReactPaginate from 'react-paginate' import styles from './Pagination.module.scss' /** currentPage: searchResults.results.current_page totalHits: searchResults.results.search_query_result.search_payload.total_hits perPage: searchResults.results.per_page */ const Pagination = ({ currentPage, totalHits, perPage, searchParams, onSearchSubmitted }) => { return ( currentPage && totalHits && perPage && totalHits > perPage ? (
} nextLabel={
} breakLabel='...' breakClassName='break-me' pageCount={Math.min(40, Math.ceil(totalHits / perPage))} marginPagesDisplayed={2} pageRangeDisplayed={5} forcePage={parseInt(currentPage, 10) - 1} onPageChange={(data) => { window.scrollTo(0, 0) onSearchSubmitted({ ...searchParams, page: data.selected + 1 }) }} containerClassName={styles.pagination} activeClassName={styles.paginationActive} disabledClassName={styles.paginationDisabled} /> ) : null ) } export default Pagination