const image = props.image; function toUrl(image) { return ( (image.ipfs_cid ? `https://ipfs.near.social/ipfs/${image.ipfs_cid}` : image.url) || "https://thewiki.io/static/media/sasha_anon.6ba19561.png" ); } const img = image.nft ? ( <Widget src="root.near/widget/NFT" props={{ contractId: image.nft.contractId, tokenId: image.nft.tokenId, thumbnail: true, }} /> ) : ( <img className="rounded w-100 h-100" style={{ objectFit: "cover" }} src={`https://i.near.social/thumbnail/${toUrl(image)["result"]}`} alt="profile image" /> ); return ( <div> <div className="profile-image float-start me-2" style={{ width: "3em", height: "3em" }} > {img} </div> </div> );