mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-28 09:03:53 +00:00
add ComplianceTip for dataset&chat
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import { useSystemStore } from '@/web/common/system/useSystemStore';
|
||||
import { Box, BoxProps } from '@chakra-ui/react';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
import { useMemo } from 'react';
|
||||
export enum TipTypeEnum {
|
||||
chat = 'chat',
|
||||
dataset = 'dataset'
|
||||
}
|
||||
const ChatTip = ({ type, ...props }: { type: `${TipTypeEnum}` } & BoxProps) => {
|
||||
const { t } = useTranslation();
|
||||
const { feConfigs } = useSystemStore();
|
||||
const textMap = useMemo(() => {
|
||||
return {
|
||||
[TipTypeEnum.chat]: t('common:compliance.chat'),
|
||||
[TipTypeEnum.dataset]: t('common:compliance.dataset')
|
||||
};
|
||||
}, [t]);
|
||||
return (
|
||||
feConfigs.show_compliance_documentation && (
|
||||
<Box
|
||||
w={'100%'}
|
||||
textAlign={'center'}
|
||||
fontSize={'0.6875rem'}
|
||||
fontWeight={'400'}
|
||||
pt={3}
|
||||
pb={[3, 0]}
|
||||
color={'myGray.400'}
|
||||
{...props}
|
||||
>
|
||||
{textMap[type]}
|
||||
</Box>
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
export default ChatTip;
|
Reference in New Issue
Block a user