const { getConfig } = VM.require("meta-pool-official.near/widget/config") const config = getConfig(context.networkId); const externalWidgetPaths = config.externalWidgetPaths; const authorId = "meta-pool-official.near" const accountId = props.accountId; const profile = props.profile ?? Social.getr(`${accountId}/profile`); const fast = !!props.fast || (!props.profile && accountId); const name = profile.name; const isPremium = !!props.isPremium; const truncateText = (text, maxLength) => { if (text.length <= maxLength) return text; return text.slice(0, maxLength) + "..."; }; const truncatedAccountId = truncateText(accountId, 30); const inner = ( <div className="d-flex flex-row"> <Widget src={externalWidgetPaths.ProfileImage} props={{ fast, profile, accountId, widgetName, style: { height: "2.5em", width: "2.5em", minWidth: "2.5em" }, className: "me-2", }} /> <div className="text-truncate lh-sm"> <div className="text-truncate fw-bold"> {name} <Widget loading={""} src={externalWidgetPaths.Checkmark} props={{ isPremium, accountId }} /> </div> <div className="text-truncate text-muted"> <small> <span className="font-monospace">@{truncatedAccountId}</span> </small> </div> </div> </div> ); return props.tooltip ? ( <Widget src={externalWidgetPaths.ProfileOverlayTrigger} props={{ accountId, children: inner }} /> ) : ( inner );