ыввы
This commit is contained in:
@@ -49,7 +49,17 @@ export const OptimizedImage = React.memo(function OptimizedImage({
|
||||
|
||||
// If src is not an upload URL, render a plain img
|
||||
if (!srcSet) {
|
||||
return <Box component="img" src={src} alt={alt} loading={priority ? 'eager' : 'lazy'} decoding="async" sx={sx} />
|
||||
return (
|
||||
<Box
|
||||
component="img"
|
||||
src={src}
|
||||
alt={alt}
|
||||
loading={priority ? 'eager' : 'lazy'}
|
||||
fetchPriority={priority ? 'high' : undefined}
|
||||
decoding="async"
|
||||
sx={sx}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
const sizesAttr = sizes ?? '(max-width: 600px) 320px, (max-width: 1024px) 640px, 1024px'
|
||||
@@ -63,6 +73,7 @@ export const OptimizedImage = React.memo(function OptimizedImage({
|
||||
src={fallbackSrc}
|
||||
alt={alt}
|
||||
loading={priority ? 'eager' : 'lazy'}
|
||||
fetchPriority={priority ? 'high' : undefined}
|
||||
decoding="async"
|
||||
sx={{ width: '100%', height: '100%', objectFit: 'cover', display: 'block' }}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user