The image is sourced from SanityCMS, and the current code (ChakraUI styling) I have is:
<Box w="500px" h="500px" bg="red">
<Image
src={allArtPieces[0].imageUrl}
alt={allArtPieces[0].title}
width="500px"
height="500px"
/>
</Box>
I would like to have the width of the image fill the container and the image to keep its natural dimensions. I have already tried setting the width of the image to 100% and leaving out the height style prop, however, the Next Image component requires that I declare a height variable. Any ideas on how I can achieve the functionality I'm aiming for?