import { Badge, Flex } from '@chakra-ui/react'; import { isString } from 'lodash-es'; import { useMemo } from 'react'; import { ImageDTO } from 'services/api'; type ImageMetadataOverlayProps = { image: ImageDTO; }; const ImageMetadataOverlay = ({ image }: ImageMetadataOverlayProps) => { const model = useMemo(() => { if (!isString(image.metadata?.model)) { return; } return image.metadata?.model; }, [image.metadata]); return ( {image.width} × {image.height} {model && ( {model} )} ); }; export default ImageMetadataOverlay;