Skip to content

Commit 2e832a4

Browse files
Merge pull request #1194 from topcoder-platform/PM-1502
Fix pagination text and no records message
2 parents d416c59 + 18e9c00 commit 2e832a4

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/apps/review/src/lib/components/TableScorecards/TableScorecards.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ export const TableScorecards: FC<Props> = (props: Props) => {
3333
const { width: screenWidth }: WindowSize = useWindowSize()
3434
const isTablet = useMemo(() => screenWidth <= 1000, [screenWidth])
3535

36+
const start = (props.page - 1) * (props.perPage ?? 0) + 1
37+
const end = Math.min(props.page * (props.perPage ?? 0), props.metadata?.total ?? 0)
38+
3639
const columns = useMemo<TableColumn<Scorecard>[]>(
3740
() => [
3841
{
@@ -153,12 +156,15 @@ export const TableScorecards: FC<Props> = (props: Props) => {
153156
)}
154157
<div className={styles.pagination}>
155158
<div className={styles.paginationText}>
156-
Showing 1-
157-
{props.perPage}
159+
Showing
160+
{' '}
161+
{start}
162+
-
163+
{end}
158164
{' '}
159165
of
160166
{' '}
161-
{props.metadata.total}
167+
{props.metadata?.total ?? 0}
162168
{' '}
163169
results
164170
</div>

src/apps/review/src/pages/scorecards/ScorecardsListPage/ScorecardsListPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const ScorecardsListPage: FC<{}> = () => {
9494
) : (
9595
<>
9696
{scorecards.length === 0 ? (
97-
<TableNoRecord />
97+
<TableNoRecord message='No scorecards were found that meet your criteria.' />
9898
) : (
9999
<TableScorecards
100100
onClone={handleScorecardClone}

0 commit comments

Comments
 (0)