|
1
|
import { HttpTypes } from "@medusajs/types" |
|
2
|
import { createColumnHelper } from "@tanstack/react-table" |
|
3
|
import { useMemo } from "react" |
|
4
|
import { useTranslation } from "react-i18next" |
|
5
|
|
|
6
|
import { |
|
7
|
TextCell, |
|
8
|
TextHeader, |
|
9
|
} from "../../../../components/table/table-cells/common/text-cell" |
|
10
|
|
|
11
|
const columnHelper = createColumnHelper<HttpTypes.AdminCurrency>() |
|
12
|
|
|
13
|
export const useCurrenciesTableColumns = () => { |
|
14
|
const { t } = useTranslation() |
|
15
|
|
|
16
|
return useMemo( |
|
17
|
() => [ |
|
18
|
columnHelper.accessor("code", { |
|
19
|
header: () => <TextHeader text={t("fields.code")} />, |
|
20
|
cell: ({ getValue }) => <TextCell text={getValue().toUpperCase()} />, |
|
21
|
}), |
|
22
|
columnHelper.accessor("name", { |
|
23
|
header: () => <TextHeader text={t("fields.name")} />, |
|
24
|
cell: ({ getValue }) => <TextCell text={getValue()} />, |
|
25
|
}), |
|
26
|
], |
|
27
|
[t] |
|
28
|
) |
|
29
|
} |