mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-09-25 08:35:42 +02:00
fix: pagination number (#8504)
This commit is contained in:
@@ -31,6 +31,8 @@ export function Pagination(props: PaginationProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const pages = usePagination(currPage, totalPages, 5);
|
const pages = usePagination(currPage, totalPages, 5);
|
||||||
|
const showingFrom = (currPage - 1) * perPage + 1;
|
||||||
|
const showingTo = Math.min(showingFrom + perPage - 1, totalCount);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@@ -98,9 +100,9 @@ export function Pagination(props: PaginationProps) {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<span className="ml-2 hidden text-sm font-normal text-gray-500 sm:block">
|
<span className="ml-2 hidden text-sm font-normal text-gray-500 sm:block">
|
||||||
Showing {formatCommaNumber((currPage - 1) * perPage)} to{' '}
|
Showing {formatCommaNumber(showingFrom)} to{' '}
|
||||||
{formatCommaNumber((currPage - 1) * perPage + perPage)} of{' '}
|
{formatCommaNumber(showingTo)} of {formatCommaNumber(totalCount)}{' '}
|
||||||
{formatCommaNumber(totalCount)} entries
|
entries
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user