'use client' import Image from 'next/image' import { useState } from 'react' interface OptimizedImageProps { src: string alt: string caption?: string width?: number height?: number priority?: boolean className?: string } export function OptimizedImage({ src, alt, caption, width = 800, height = 600, priority = false, className = '', }: OptimizedImageProps) { const [isLoading, setIsLoading] = useState(true) const [hasError, setHasError] = useState(false) if (hasError) { return (
Failed to load image
{caption &&{caption}
}