Skip to content

Commit 7fc21fd

Browse files
div-LeoLeonardo Di Vittorio
andauthored
fix: isLastPage true if 0 items (#64)
* fix: isLastPage true if 0 items * fix: explicit check 0 results items * fix: when 0 items return true Co-authored-by: Leonardo Di Vittorio <leo@MacBook-Pro-de-Leonardo.local>
1 parent 742386e commit 7fc21fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/Pagination/Pagination.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ const Pagination: React.FC<PaginationProps> = ({
105105
onSkipBackward
106106
}) => {
107107
const isFirstPage = value === 1;
108-
const isLastPage = value === Math.ceil(totalItems / pageSize);
108+
const isLastPage = totalItems > 0 ? value === Math.ceil(totalItems / pageSize) : true;
109109

110110
return (
111111
<Container>

0 commit comments

Comments
 (0)