Skip to content

Commit ab570f7

Browse files
fix: showing 1/0 for pagination with no pages (#1714)
1 parent fef4dd7 commit ab570f7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ui/admin/app/components/composed/PaginationActions.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ export function PaginationActions({
2020
const hasNextPage = nextPage != null;
2121
const hasPreviousPage = previousPage != null;
2222

23+
const currentPage = totalPages ? page + 1 : 0;
24+
2325
return (
2426
<div className="flex flex-nowrap items-center justify-center gap-2">
2527
<Button
@@ -32,7 +34,7 @@ export function PaginationActions({
3234
</Button>
3335

3436
<p className="min-w-fit">
35-
{page + 1} / {totalPages}
37+
{currentPage} / {totalPages}
3638
</p>
3739

3840
<Button

0 commit comments

Comments
 (0)