import type { ImgHTMLAttributes } from "react";

type NextImageProps = ImgHTMLAttributes<HTMLImageElement> & {
  src: string | { src: string };
  alt: string;
  fill?: boolean;
  priority?: boolean;
};

export default function NextImage({
  src,
  alt,
  fill: _fill,
  priority: _priority,
  fetchPriority: _fetchPriority,
  ...props
}: NextImageProps) {
  const imageSrc = typeof src === "string" ? src : src.src;
  return <img src={imageSrc} alt={alt} {...props} />;
}
