Skip to content

Commit

Permalink
fix: showing 1/0 for pagination with no pages (#1714)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhopperlowe authored Feb 11, 2025
1 parent fef4dd7 commit ab570f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ui/admin/app/components/composed/PaginationActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export function PaginationActions({
const hasNextPage = nextPage != null;
const hasPreviousPage = previousPage != null;

const currentPage = totalPages ? page + 1 : 0;

return (
<div className="flex flex-nowrap items-center justify-center gap-2">
<Button
Expand All @@ -32,7 +34,7 @@ export function PaginationActions({
</Button>

<p className="min-w-fit">
{page + 1} / {totalPages}
{currentPage} / {totalPages}
</p>

<Button
Expand Down

0 comments on commit ab570f7

Please sign in to comment.