Raw
1 import { Table } from "@medusajs/ui"
2 import { ComponentPropsWithoutRef, ElementRef, forwardRef } from "react"
3 import { useTranslation } from "react-i18next"
4
5 type LocalizedTablePaginationProps = Omit<
6 ComponentPropsWithoutRef<typeof Table.Pagination>,
7 "translations"
8 >
9
10 export const LocalizedTablePagination = forwardRef<
11 ElementRef<typeof Table.Pagination>,
12 LocalizedTablePaginationProps
13 >((props, ref) => {
14 const { t } = useTranslation()
15
16 const translations = {
17 of: t("general.of"),
18 results: t("general.results"),
19 pages: t("general.pages"),
20 prev: t("general.prev"),
21 next: t("general.next"),
22 }
23
24 return <Table.Pagination {...props} translations={translations} ref={ref} />
25 })
26 LocalizedTablePagination.displayName = "LocalizedTablePagination"