optimize img tag

This commit is contained in:
Ren Amamiya
2023-04-24 09:16:10 +07:00
parent 740dc85f13
commit 2014720f93
14 changed files with 66 additions and 10 deletions

View File

@@ -3,7 +3,7 @@ import { memo } from 'react';
export const ImagePreview = memo(function ImagePreview({ url, size }: { url: string; size: string }) {
return (
<div className={`relative h-full ${size === 'large' ? 'w-4/5' : 'w-1/2'} mt-2 rounded-lg border border-zinc-800`}>
<img src={url} alt={url} className="h-auto w-full rounded-lg object-cover" />
<img src={url} alt={url} className="h-auto w-full rounded-lg object-cover" loading="lazy" fetchpriority="high" />
</div>
);
});