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