import { Image, ImageProps } from '@graphcommerce/image' import React from 'react' import { AssetFragment } from './Asset.gql' type ImageAsset = Pick & { width: number height: number } function isImage(asset: AssetFragment): asset is ImageAsset { return !!(asset.width && asset.height) } type AssetProps = { asset: AssetFragment } & Pick export default function Asset(props: AssetProps) { const { asset, sizes } = props if (isImage(asset)) { return ( {asset.alt ) } if (asset.mimeType === 'video/mp4') { return