Skip to content

Commit

Permalink
fix: table pagination count
Browse files Browse the repository at this point in the history
  • Loading branch information
tonai committed Nov 13, 2023
1 parent ec53f2c commit 2fa051a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/react-front-kit-table/src/Components/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export function Table<Data extends Record<string, unknown>>(
rowActionNumber = 0,
...mantineTableProps
} = props;
const { enablePagination = true, data, manualPagination } = mantineTableProps;
const { enablePagination = true, manualPagination } = mantineTableProps;
const { classes } = useStyles();
const [confirmAction, setConfirmAction] =
useState<IConfirmAction<Data> | null>(null);
Expand Down Expand Up @@ -319,7 +319,7 @@ export function Table<Data extends Record<string, unknown>>(
},
...mantineTableProps,
});
const { getState, setPageIndex, setPageSize } = table;
const { getPageCount, getState, setPageIndex, setPageSize } = table;
const { pagination } = getState();
const { pageIndex, pageSize } = pagination;

Expand All @@ -344,7 +344,7 @@ export function Table<Data extends Record<string, unknown>>(
onItemsPerPageChange={handleItemsPerPageChange}
onPageChange={handlePageChange}
page={pageIndex + 1}
totalPages={Math.ceil(data.length / pageSize)}
totalPages={getPageCount()}
/>
) : (
paginationProps !== undefined && (
Expand Down

0 comments on commit 2fa051a

Please sign in to comment.