flotilla/src/app/editor/ProfileSuggestion.svelte

36 lines
996 B
Svelte
Raw Normal View History

2024-08-20 20:20:45 +00:00
<script lang="ts">
2026-07-28 16:16:26 +00:00
import {displayHandle} from "@welshman/util"
import {displayPubkey} from "@welshman/domain"
import {handles, profiles} from "@app/core"
2025-06-05 19:25:55 +00:00
import WotScore from "@app/components/WotScore.svelte"
2025-01-02 18:04:28 +00:00
import ProfileCircle from "@app/components/ProfileCircle.svelte"
2024-08-22 23:16:35 +00:00
2025-04-15 18:03:27 +00:00
type Props = {
value: string
url?: string
}
const {value, url}: Props = $props()
2025-02-05 03:37:59 +00:00
const pubkey = value
2026-07-28 16:16:26 +00:00
const profileDisplay = $profiles.display(pubkey).$
const handle = $handles.forPubkey(pubkey).$
2024-08-20 20:20:45 +00:00
</script>
<div class="flex max-w-full gap-3">
<div class="py-1">
2025-04-15 18:03:27 +00:00
<ProfileCircle {pubkey} {url} />
</div>
<div class="flex min-w-0 flex-col">
<div class="flex items-center gap-2">
<div class="text-bold overflow-hidden text-ellipsis">
{$profileDisplay}
</div>
2025-06-05 19:25:55 +00:00
<WotScore {pubkey} />
</div>
<div class="overflow-hidden text-ellipsis text-sm opacity-75">
{$handle ? displayHandle($handle) : displayPubkey(pubkey)}
</div>
</div>
</div>