update pay function
This commit is contained in:
24
src/views/AgentChat/neuratalk/components/Image/MCPImage.tsx
Normal file
24
src/views/AgentChat/neuratalk/components/Image/MCPImage.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import { useState } from "react";
|
||||
import { default as NextImage, ImageProps } from "next/image";
|
||||
|
||||
const MCPImage = ({ className, src, ...props }: ImageProps) => {
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
|
||||
// 处理图片路径 - 如果是相对路径,添加 basePath
|
||||
const processedSrc = typeof src === 'string' && src.startsWith('/') && !src.startsWith('/ai-chat')
|
||||
? `/ai-chat${src}`
|
||||
: src;
|
||||
|
||||
return (
|
||||
<NextImage
|
||||
className={`inline-block align-top opacity-0 transition-opacity ${
|
||||
loaded && "opacity-100"
|
||||
} ${className || ""}`}
|
||||
onLoad={() => setLoaded(true)}
|
||||
src={processedSrc}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default MCPImage;
|
||||
Reference in New Issue
Block a user