* feat: app/dataset support group (#2898) * pref: member-group (#2862) * feat: group list ordered by updateTime * fix: transfer ownership of group when deleting member * fix: i18n fix * feat: can not set member as admin/owner when user is not active * fix: GroupInfoModal hover input do not change color * fix(fe): searchinput do not scroll * feat: app collaborator with group, remove default permission * feat: dataset collaborator with group, remove default permission * chore(test): pref mock * chore: remove useless code * chore: adjust * fix: add self as collaborator when creating folder * fix(fe): folder manage menu do not show when user has write permission only * fix: dataset folder create * feat: Add code comment * Pref: app move (#2952) * perf: app schema * doc --------- Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
30 lines
877 B
TypeScript
30 lines
877 B
TypeScript
import React from 'react';
|
|
import { PermissionTypeMap } from '@fastgpt/global/support/permission/constant';
|
|
import { Box, StackProps, HStack } from '@chakra-ui/react';
|
|
import MyIcon from '@fastgpt/web/components/common/Icon';
|
|
import { useTranslation } from 'next-i18next';
|
|
|
|
const PermissionIconText = ({
|
|
w = '1rem',
|
|
fontSize = 'mini',
|
|
iconColor = 'myGray.500',
|
|
private: Private = false,
|
|
...props
|
|
}: {
|
|
private?: boolean;
|
|
iconColor?: string;
|
|
} & StackProps) => {
|
|
const { t } = useTranslation();
|
|
|
|
const per = Private ? 'private' : 'public';
|
|
|
|
return PermissionTypeMap[per] ? (
|
|
<HStack spacing={1} fontSize={fontSize} {...props}>
|
|
<MyIcon name={PermissionTypeMap[per]?.iconLight as any} w={w} color={iconColor} />
|
|
<Box lineHeight={1}>{t(PermissionTypeMap[per]?.label as any)}</Box>
|
|
</HStack>
|
|
) : null;
|
|
};
|
|
|
|
export default PermissionIconText;
|