mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-21 03:10:50 +00:00
v4.6 -1 (#459)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import React from 'react';
|
||||
import { PermissionTypeEnum, PermissionTypeMap } from '@fastgpt/global/support/permission/constant';
|
||||
import { Box, Flex, FlexProps } from '@chakra-ui/react';
|
||||
import MyIcon from '@/components/Icon';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const PermissionIconText = ({
|
||||
permission,
|
||||
...props
|
||||
}: { permission: `${PermissionTypeEnum}` } & FlexProps) => {
|
||||
const { t } = useTranslation();
|
||||
return PermissionTypeMap[permission] ? (
|
||||
<Flex alignItems={'center'} {...props}>
|
||||
<MyIcon name={PermissionTypeMap[permission]?.iconLight as any} w={'14px'} />
|
||||
<Box ml={'1px'}>{t(PermissionTypeMap[permission]?.label)}</Box>
|
||||
</Flex>
|
||||
) : null;
|
||||
};
|
||||
|
||||
export default PermissionIconText;
|
Reference in New Issue
Block a user