hello new update

This commit is contained in:
2025-07-23 23:34:43 +03:00
parent cb2b4f0d86
commit dfc8e21db1
16 changed files with 279 additions and 277 deletions

View File

@@ -1,5 +1,6 @@
import React from 'react';
import { useThumbnailLazyLoad } from '@/hooks/use-lazy-load';
import { useThumbnailURL } from '@/hooks/use-lazy-load';
import { Skeleton } from './ui/skeleton';
interface LazyLoadedImageProps {
imgId: string;
@@ -7,15 +8,19 @@ interface LazyLoadedImageProps {
[prop: string]: string
}
const LazyLoadedImage: React.FC<LazyLoadedImageProps> = ({ imgId, alt, ...props }: LazyLoadedImageProps) => {
const imgUrl = useThumbnailLazyLoad(imgId);
const LazyLoadedImage: React.FC<React.ImgHTMLAttributes<HTMLImageElement> & LazyLoadedImageProps> = ({
imgId,
alt,
...props
}) => {
const imgUrl = useThumbnailURL(imgId);
return (
<div>
{imgUrl ? (
<img src={imgUrl} alt={alt} {...props} />
) : (
<p>Loading...</p>
<Skeleton {...props} />
)}
</div>
);