// ═══════════════════════════════════════════════════════════════════
// src/components/Photo.jsx
// Lazy-loaded image that silently removes itself on network error.
// Fallback content (gradient or initials) must be provided by the
// parent behind this element in the stacking context.
// ═══════════════════════════════════════════════════════════════════

const { useState } = React;

function Photo({ src, alt, className, style }) {
  const [failed, setFailed] = useState(false);
  if (failed) return null;
  return (
    <img
      src={src}
      alt={alt}
      className={className}
      style={style}
      loading="lazy"
      decoding="async"
      onError={() => setFailed(true)}
    />
  );
}
