Improve profile search

This commit is contained in:
Jon Staab
2024-09-24 16:30:32 -07:00
parent 605273d7c7
commit cb702976ee
13 changed files with 50 additions and 36 deletions
+10 -5
View File
@@ -1,20 +1,25 @@
<script lang="ts">
import {displayPubkey} from "@welshman/util"
import {deriveProfile, deriveProfileDisplay, formatTimestamp} from "@welshman/app"
import {deriveProfile, deriveHandleForPubkey, displayHandle, deriveProfileDisplay, formatTimestamp} from "@welshman/app"
import Avatar from "@lib/components/Avatar.svelte"
export let pubkey
const profile = deriveProfile(pubkey)
const profileDisplay = deriveProfileDisplay(pubkey)
const handle = deriveHandleForPubkey(pubkey)
</script>
<div class="flex gap-2">
<div class="flex gap-2 max-w-full">
<div class="py-1">
<Avatar src={$profile?.picture} size={10} />
</div>
<div class="flex flex-col">
<div class="text-bold">{$profileDisplay}</div>
<div class="text-sm opacity-75">{displayPubkey(pubkey)}</div>
<div class="flex flex-col min-w-0">
<div class="text-bold text-ellipsis overflow-hidden">
{$profileDisplay}
</div>
<div class="text-sm opacity-75 text-ellipsis overflow-hidden">
{$handle ? displayHandle($handle) : displayPubkey(pubkey)}
</div>
</div>
</div>