-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Expand file tree
/
Copy pathPagination.tsx
More file actions
31 lines (27 loc) · 949 Bytes
/
Pagination.tsx
File metadata and controls
31 lines (27 loc) · 949 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import BasePagination from '@node-core/ui-components/Common/BasePagination';
import { useTranslations } from 'next-intl';
import Link from '#site/components/Link';
import type { PaginationProps } from '@node-core/ui-components/Common/BasePagination';
import type { FC } from 'react';
const Pagination: FC<
Omit<PaginationProps, 'as' | 'labels' | 'getPageLabel'>
> = props => {
const t = useTranslations();
return (
<BasePagination
as={Link}
labels={{
aria: t('components.common.pagination.defaultLabel'),
prevAria: t('components.common.pagination.prevAriaLabel'),
prev: t('components.pagination.previous'),
nextAria: t('components.common.pagination.nextAriaLabel'),
next: t('components.pagination.next'),
}}
getPageLabel={pageNumber =>
t('components.common.pagination.pageLabel', { pageNumber })
}
{...props}
/>
);
};
export default Pagination;