mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
feat(core): make permission and invoice offline available (#8123)
This commit is contained in:
@@ -6,19 +6,21 @@ import ReactPaginate from 'react-paginate';
|
||||
import * as styles from './styles.css';
|
||||
export interface PaginationProps {
|
||||
totalCount: number;
|
||||
pageNum?: number;
|
||||
countPerPage: number;
|
||||
onPageChange: (skip: number) => void;
|
||||
onPageChange: (skip: number, pageNum: number) => void;
|
||||
}
|
||||
|
||||
export const Pagination = ({
|
||||
totalCount,
|
||||
countPerPage,
|
||||
pageNum,
|
||||
onPageChange,
|
||||
}: PaginationProps) => {
|
||||
const handlePageClick = useCallback(
|
||||
(e: { selected: number }) => {
|
||||
const newOffset = (e.selected * countPerPage) % totalCount;
|
||||
onPageChange(newOffset);
|
||||
onPageChange(newOffset, e.selected);
|
||||
},
|
||||
[countPerPage, onPageChange, totalCount]
|
||||
);
|
||||
@@ -34,6 +36,7 @@ export const Pagination = ({
|
||||
pageRangeDisplayed={3}
|
||||
marginPagesDisplayed={2}
|
||||
pageCount={pageCount}
|
||||
forcePage={pageNum}
|
||||
previousLabel={<ArrowLeftSmallIcon />}
|
||||
nextLabel={<ArrowRightSmallIcon />}
|
||||
pageClassName={styles.pageItem}
|
||||
|
||||
Reference in New Issue
Block a user