offiaccount welcome text (#4827)

* offiaccount welcome text

* fix

* Update Image.tsx

---------

Co-authored-by: Archer <545436317@qq.com>
This commit is contained in:
heheer
2025-05-17 22:03:18 +08:00
committed by GitHub
parent 932aa28a1f
commit c6e0b5a1e7
4 changed files with 10 additions and 0 deletions

View File

@@ -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