import Image from "next/image"; import { useState } from "react"; import { ImageOverlayWrapper } from "../../ui/image-overlay-wrapper"; export const ImageComponent = (props) => { const [dimensions, setDimensions] = useState({ width: 16, height: 9 }); const [isLoading, setIsLoading] = useState(true); const handleImageLoad = (event) => { const img = event.target as HTMLImageElement; if (img) { setDimensions({ width: img.naturalWidth, height: img.naturalHeight, }); setIsLoading(false); } }; return ( {props?.alt {props?.caption && ( Figure: {props.caption} )} ); };