-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMvPagination.jsx
41 lines (40 loc) · 1.19 KB
/
MvPagination.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import ReactPaginate from 'react-paginate';
/**
* MvPagination.
*
* Purpose:
* - Render a paginaton
*
* References:
* - https://www.npmjs.com/package/react-paginate
*
* @param clickPagination function on click page.
* @param pageCount Page coount.
* @returns pagination component
*/
export const MvPagination = ({ clickPagination, pageCount }) => {
return (
<div className='mvPagination'>
<ReactPaginate
breakLabel='...'
nextLabel='>'
previousLabel='<'
onPageChange={clickPagination}
pageRangeDisplayed={2}
marginPagesDisplayed={2}
pageCount={pageCount}
renderOnZeroPageCount={null}
containerClassName='mvPagination__container'
pageClassName='mvPagination__page-item'
pageLinkClassName='mvPagination__page-link'
previousClassName='mvPagination__page-item'
previousLinkClassName='mvPagination__page-link'
nextClassName='mvPagination__page-item'
nextLinkClassName='mvPagination__page-link'
activeLinkClassName='mvPagination__active'
breakClassName='mvPagination__page-item'
breakLinkClassName='mvPagination__page-link'
/>
</div>
);
};