import { type CSSProperties, type MouseEvent, type Ref, memo } from "react"; export interface ImageProps { alt?: string; src: string; sources?: readonly ImageSource[]; className?: string; style?: CSSProperties; width?: number; height?: number; onClick?: (e: MouseEvent) => void; ref?: Ref; } export interface ImageSource { srcSet: string; media?: string; type?: "image/avif" | "image/webp" | "image/png"; } export default memo(function Image({ alt, src, sources, className, width, height, onClick, ref, }: ImageProps) { return ( {sources?.map((s) => ( ))} {/* biome-ignore lint/a11y/useKeyWithClickEvents: we're just passing it down */} {alt} ); });