feat translation of the user module
Signed-off-by: jingyang <3161362058@qq.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import React, { useMemo } from 'react';
|
||||
import { Box, Flex, useTheme } from '@chakra-ui/react';
|
||||
import type { GridProps } from '@chakra-ui/react';
|
||||
import MyIcon, { type IconName } from '../Icon';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
|
||||
// @ts-ignore
|
||||
export interface Props extends GridProps {
|
||||
@@ -12,6 +13,7 @@ export interface Props extends GridProps {
|
||||
}
|
||||
|
||||
const SideTabs = ({ list, size = 'md', activeId, onChange, ...props }: Props) => {
|
||||
const { t } = useTranslation();
|
||||
const sizeMap = useMemo(() => {
|
||||
switch (size) {
|
||||
case 'sm':
|
||||
@@ -61,7 +63,7 @@ const SideTabs = ({ list, size = 'md', activeId, onChange, ...props }: Props) =>
|
||||
}}
|
||||
>
|
||||
<MyIcon mr={2} name={item.icon as IconName} w={'16px'} />
|
||||
{item.label}
|
||||
{t(item.label)}
|
||||
</Flex>
|
||||
))}
|
||||
</Box>
|
||||
|
||||
Reference in New Issue
Block a user