"use client"; import { useState } from "react"; export function ProfileImage({ src, alt, width, height, fallback, className, }: { src: string; alt: string; width: number; height: number; fallback?: string; className?: string; }) { const [failedSrc, setFailedSrc] = useState(null); const failed = failedSrc === src; if (failed && !fallback) return ( {alt.slice(0, 1).toUpperCase()} ); return ( {alt} setFailedSrc(src)} /> ); }