Files
vf_react/src/views/AgentChat/neuratalk/components/Image/index.tsx
2025-11-22 08:57:37 +08:00

19 lines
501 B
TypeScript

import { useState } from "react";
import { default as NextImage, ImageProps } from "next/image";
const Image = ({ className, ...props }: ImageProps) => {
const [loaded, setLoaded] = useState(false);
return (
<NextImage
className={`inline-block align-top opacity-0 transition-opacity ${
loaded && "opacity-100"
} ${className || ""}`}
onLoad={() => setLoaded(true)}
{...props}
/>
);
};
export default Image;