update pay function

This commit is contained in:
2025-11-22 10:28:37 +08:00
parent 8c321e1634
commit f05facdf50
6 changed files with 230 additions and 50 deletions

View 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;