import Image from "next/image";

type NewsCoverImageProps = {
  src: string;
  alt: string;
  priority?: boolean;
  className?: string;
  sizes?: string;
};

export function NewsCoverImage({
  src,
  alt,
  priority = false,
  className = "",
  sizes = "(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 640px",
}: NewsCoverImageProps) {
  return (
    <Image
      src={src}
      alt={alt}
      fill
      sizes={sizes}
      className={`object-cover object-center ${className}`.trim()}
      priority={priority}
    />
  );
}
