feat(core): make permission and invoice offline available (#8123)

This commit is contained in:
EYHN
2024-09-05 15:11:27 +00:00
parent 8be67dce82
commit f4db4058f8
17 changed files with 236 additions and 186 deletions

View File

@@ -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}