{#snippet userBadge(identifier: string, displayText: string | undefined)} {@const npub = toNpub(identifier)} {#if npub} {#if !displayText || displayText.trim().toLowerCase() === "unknown"} {#await getUserMetadata(npub) then profile} {@const p = profile as NostrProfileWithLegacy} {:catch} {/await} {:else} {#await createProfileLinkWithVerification(npub as string, displayText)} {:then html} {@html html.replace(/([\s\S]*<\/a>)/, "").trim()} {:catch} {/await} {/if} {:else} {displayText ?? ""} {/if} {/snippet}