From f35a9f0950f540f1edfabd3c261e05813d7ca425 Mon Sep 17 00:00:00 2001 From: Brian Cao Date: Thu, 17 Aug 2023 12:39:58 -0700 Subject: [PATCH] Add page of intl. --- components/common/Pager.js | 8 ++++++-- lib/constants.ts | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/components/common/Pager.js b/components/common/Pager.js index 584e0669..4a00590d 100644 --- a/components/common/Pager.js +++ b/components/common/Pager.js @@ -1,7 +1,9 @@ import styles from './Pager.module.css'; import { Button, Flexbox, Icon, Icons } from 'react-basics'; +import useMessages from 'hooks/useMessages'; -export function Pager({ page, pageSize, count, onPageChange, onPageSizeChange }) { +export function Pager({ page, pageSize, count, onPageChange }) { + const { formatMessage, labels } = useMessages(); const maxPage = Math.ceil(count / pageSize); const lastPage = page === maxPage; const firstPage = page === 1; @@ -24,7 +26,9 @@ export function Pager({ page, pageSize, count, onPageChange, onPageSizeChange }) - {`Page ${page} of ${maxPage}`} + + {formatMessage(labels.pageOf, { x: page, y: maxPage })} +