mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-22 20:37:48 +00:00
offiaccount welcome text (#4827)
* offiaccount welcome text * fix * Update Image.tsx --------- Co-authored-by: Archer <545436317@qq.com>
This commit is contained in:
@@ -2,8 +2,10 @@ import React, { useState } from 'react';
|
||||
import { Box, type ImageProps, Skeleton } from '@chakra-ui/react';
|
||||
import MyPhotoView from '@fastgpt/web/components/common/Image/PhotoView';
|
||||
import { useBoolean } from 'ahooks';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
|
||||
const MdImage = ({ src, ...props }: { src?: string } & ImageProps) => {
|
||||
const { t } = useTranslation();
|
||||
const [isLoaded, { setTrue }] = useBoolean(false);
|
||||
|
||||
const [renderSrc, setRenderSrc] = useState(src);
|
||||
@@ -11,6 +13,11 @@ const MdImage = ({ src, ...props }: { src?: string } & ImageProps) => {
|
||||
if (src?.includes('base64') && !src.startsWith('data:image')) {
|
||||
return <Box>Invalid base64 image</Box>;
|
||||
}
|
||||
|
||||
if (props.alt?.startsWith('OFFIACCOUNT_MEDIA')) {
|
||||
return <Box>{t('common:not_support_wechat_image')}</Box>;
|
||||
}
|
||||
|
||||
return (
|
||||
<Skeleton isLoaded={isLoaded}>
|
||||
<MyPhotoView
|
||||
|
Reference in New Issue
Block a user