import React, { type FC, useCallback, useState } from 'react'; import { BlurhashCanvas } from 'react-blurhash'; import { LazyLoadImage } from 'react-lazy-load-image-component'; const imageStyle: React.CSSProperties = { position: 'absolute', top: 0, bottom: 0, left: 0, right: 0, width: '100%', height: '100%', zIndex: 0 }; interface ImageProps { imgUrl: string; blurhash?: string; containImage: boolean; } const Image: FC = ({ imgUrl, blurhash, containImage }) => { const [isLoaded, setIsLoaded] = useState(false); const [isLoadStarted, setIsLoadStarted] = useState(false); const handleLoad = useCallback(() => { setIsLoaded(true); }, []); const handleLoadStarted = useCallback(() => { setIsLoadStarted(true); }, []); return (
{!isLoaded && isLoadStarted && blurhash && ( )}
); }; export default Image;