Skip to content

Commit

Permalink
Merge pull request #195 from Enterprise-CMCS/count
Browse files Browse the repository at this point in the history
fix(maxRecordCount): Add maxRecordCount to pagination
  • Loading branch information
benjaminpaige authored Nov 14, 2023
2 parents 3a9d290 + 529abc7 commit 0414968
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/services/ui/src/components/Pagination/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ import type { Props } from "./types";
import { pageStateResolver } from "./utils";
import { cn } from "@/lib/utils";

const maxRecordCount = 10000;

export const Pagination: FC<Props> = (props) => {
const count = props.count > maxRecordCount ? maxRecordCount : props.count;
const state = pageStateResolver({
pageNumber: props.pageNumber,
pageSize: props.pageSize,
count: props.count,
count,
});

return (
Expand Down Expand Up @@ -39,7 +42,7 @@ export const Pagination: FC<Props> = (props) => {
<span className="font-bold">{state.lowerBoundValue}</span>-
<span className="font-bold">{state.upperBoundValue}</span>
of
<span className="font-bold">{props.count}</span>
<span className="font-bold">{count}</span>
records
</p>
</div>
Expand Down

0 comments on commit 0414968

Please sign in to comment.