/** * Оптимизированный компонент изображения */ 'use client'; import Image from 'next/image'; import { useState } from 'react'; interface OptimizedImageProps { src: string; alt: string; width?: number; height?: number; className?: string; priority?: boolean; placeholder?: 'blur' | 'empty'; blurDataURL?: string; } export function OptimizedImage({ src, alt, width, height, className, priority = false, placeholder = 'empty', blurDataURL, }: OptimizedImageProps) { const [error, setError] = useState(false); if (error) { return (
{alt}
); } return ( {alt} setError(true)} loading={priority ? undefined : 'lazy'} decoding="async" /> ); }