Skip to content

Commit

Permalink
Fix : First item on pagination (#523)
Browse files Browse the repository at this point in the history
fix : put condition on firstItemOnPage pagination props
  • Loading branch information
JeanneGrenet authored Sep 6, 2024
1 parent 0de897f commit e256bd7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Pagination/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const getPaginationInfo = ({
pageSize = 10,
totalItems = 0,
}) => {
const firstItemOnPage = (page - 1) * pageSize + 1;
const firstItemOnPage = totalItems > 0 ? (page - 1) * pageSize + 1 : 0;
const lastItemOnPage = Math.min(
(page - 1) * pageSize + pageSize,
totalItems ?? 0
Expand Down

0 comments on commit e256bd7

Please sign in to comment.