This commit is contained in:
2025-02-14 11:59:11 +02:00
parent e6b898ef09
commit 9ddf068049
73 changed files with 5767 additions and 126 deletions

View File

@@ -0,0 +1,24 @@
import React from 'react';
import { useGameThumbnailLazyLoad } from '@/hooks/use-lazy-load';
interface LazyLoadedImageProps {
imgId: string;
alt: string;
[prop: string]: string
}
const LazyLoadedImage: React.FC<LazyLoadedImageProps> = ({ imgId, alt, ...props }: LazyLoadedImageProps) => {
const imgUrl = useGameThumbnailLazyLoad(imgId);
return (
<div>
{imgUrl ? (
<img src={imgUrl} alt={alt} {...props} />
) : (
<p>Loading...</p>
)}
</div>
);
};
export default LazyLoadedImage;