import { Newspaper } from "lucide-react";
import SafeImage from "@/components/ui/SafeImage";

/**
 * Article image, or a branded placeholder when the post has none (B19). The
 * old fallback cropped the Biznie logo to 16:9, which read as a broken image.
 */
export default function NewsImage({ src, alt, sizes }: { src: string | null; alt: string; sizes: string }) {
  if (src) {
    return <SafeImage src={src} alt={alt} fill sizes={sizes} className="object-cover" />;
  }
  return (
    <div className="flex h-full w-full items-center justify-center bg-gradient-to-br from-[#CC1414] to-[#8B0000]" aria-hidden>
      <Newspaper size={36} className="text-white/70" strokeWidth={1.5} />
    </div>
  );
}
