interface AvatarProps {
src: string;
alt?: string;
}
// alt may be undefined, so provide a fallback
function Avatar({ src, alt }: AvatarProps) {
return <img src={src} alt={alt ?? "avatar"} />;
}
export default Avatar;mark props optional and handle the missing case