flotilla/src/app/editor/ProfileSuggestion.svelte

36 lines
1 KiB
Svelte
Raw Normal View History

2024-08-20 20:20:45 +00:00
<script lang="ts">
import {removeNil} from "@welshman/lib"
2025-06-05 19:25:55 +00:00
import {displayPubkey} from "@welshman/util"
import {deriveHandleForPubkey, displayHandle, deriveProfileDisplay} from "@welshman/app"
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
const profileDisplay = deriveProfileDisplay(pubkey, removeNil([url]))
const handle = deriveHandleForPubkey(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">
2025-01-02 18:04:28 +00:00
<div class="text-bold overflow-hidden text-ellipsis text-base">
{$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>