feat: sandbox support str to base64 function;feat: compiance text ui (#2702)
* feat: sandbox strToBase64 function * feat: compiance text ui
This commit is contained in:
33
projects/app/src/components/common/ComplianceTip/index.tsx
Normal file
33
projects/app/src/components/common/ComplianceTip/index.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import { useSystemStore } from '@/web/common/system/useSystemStore';
|
||||
import { Box, BoxProps } from '@chakra-ui/react';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
const ChatTip = ({ type, ...props }: { type: 'chat' | 'dataset' } & BoxProps) => {
|
||||
const { t } = useTranslation();
|
||||
const { feConfigs } = useSystemStore();
|
||||
|
||||
const textMap = useMemo(() => {
|
||||
return {
|
||||
chat: t('common:compliance.chat'),
|
||||
dataset: t('common:compliance.dataset')
|
||||
};
|
||||
}, [t]);
|
||||
|
||||
return feConfigs.show_compliance_copywriting ? (
|
||||
<Box
|
||||
w={'100%'}
|
||||
textAlign={'center'}
|
||||
fontSize={'0.6875rem'}
|
||||
fontWeight={'400'}
|
||||
pt={3}
|
||||
pb={[3, 0]}
|
||||
color={'myGray.400'}
|
||||
{...props}
|
||||
>
|
||||
{textMap[type]}
|
||||
</Box>
|
||||
) : null;
|
||||
};
|
||||
|
||||
export default ChatTip;
|
||||
Reference in New Issue
Block a user