Skip to content

Fix pagination text and no records message#1194

Merged
himaniraghav3 merged 1 commit intofeat/reviewfrom
PM-1502
Aug 19, 2025
Merged

Fix pagination text and no records message#1194
himaniraghav3 merged 1 commit intofeat/reviewfrom
PM-1502

Conversation

@himaniraghav3
Copy link
Collaborator

Related JIRA Ticket:

https://topcoder.atlassian.net/browse/PM-1502

What's in this PR?

const { width: screenWidth }: WindowSize = useWindowSize()
const isTablet = useMemo(() => screenWidth <= 1000, [screenWidth])

const start = (props.page - 1) * (props.perPage ?? 0) + 1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a default value for props.perPage to avoid potential issues if it is undefined. For example, you could use a default value of 1 or another appropriate number.

const isTablet = useMemo(() => screenWidth <= 1000, [screenWidth])

const start = (props.page - 1) * (props.perPage ?? 0) + 1
const end = Math.min(props.page * (props.perPage ?? 0), props.metadata?.total ?? 0)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the previous line, ensure that props.perPage has a sensible default value to prevent unexpected behavior if it is undefined.

of
{' '}
{props.metadata.total}
{props.metadata?.total ?? 0}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using a default value for props.metadata.total directly in the destructuring assignment or initialization to avoid using the nullish coalescing operator here.

@himaniraghav3 himaniraghav3 merged commit 2e832a4 into feat/review Aug 19, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant