const image = props.image; const className = props.className; const style = props.style; const alt = props.alt; const fallbackUrl = props.fallbackUrl; const thumbnail = props.thumbnail; function toUrl(image) { return ( (image.ipfs_cid ? `https://ipfs.near.social/ipfs/${image.ipfs_cid}` : image.url) || fallbackUrl ); } return image.nft.contractId && image.nft.tokenId ? ( <Widget src="duocelot.near/widget/NftImage" props={{ className, style, alt, nft: image.nft, thumbnail, fallbackUrl, }} /> ) : ( <img className={className} style={style} src={ thumbnail ? `https://i.near.social/${thumbnail}/${toUrl(image)}` : toUrl(image) } alt={alt} /> );