fix: pagination number (#8504)

pull/8480/head^2
Arik Chakma 1 week ago committed by GitHub
parent 8b69b266d5
commit f279aea1cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      src/components/Pagination/Pagination.tsx

@ -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>
); );

Loading…
Cancel
Save