diff --git a/src/components/blocks/image.tsx b/src/components/blocks/image.tsx index b9cb73e..123228d 100644 --- a/src/components/blocks/image.tsx +++ b/src/components/blocks/image.tsx @@ -7,16 +7,20 @@ type ImageProps = { export const Image = (props: ImageProps) => { // TODO: USE OTHER PROPERTIES - const { block_id, alt_text, image_url, image_bytes, image_height, image_width } = props.data; + const { block_id, alt_text, image_url, image_bytes, image_height, image_width, title } = + props.data; const [showImage, setShowImage] = useState(true); + const captionText = title?.text; return (
- - {alt_text} - {image_bytes && ` (${Math.round(image_bytes / 1000)} kB)`} - + {captionText && {captionText}} + {image_bytes && ( + + {`(${Math.round(image_bytes / 1000)} kB)`} + + )}