import { useState } from 'react' import { getStrapiMedia } from '@/lib/strapi-utils' interface StrapiImageProps { src: string | undefined | null alt?: string | null className?: string width?: number | string height?: number | string } export function StrapiImage({ src, alt, className = '', width, height, }: StrapiImageProps) { const [hasError, setHasError] = useState(false) if (!src) return null const imageUrl = getStrapiMedia(src) if (hasError) { return (
Image not available
) } return ( {alt setHasError(true)} /> ) }