flotilla/src/app/components/Profile.svelte

26 lines
821 B
Svelte
Raw Normal View History

2024-09-24 21:12:38 +00:00
<script lang="ts">
import {displayPubkey} from "@welshman/util"
2024-09-24 23:30:32 +00:00
import {deriveProfile, deriveHandleForPubkey, displayHandle, deriveProfileDisplay, formatTimestamp} from "@welshman/app"
2024-09-24 21:12:38 +00:00
import Avatar from "@lib/components/Avatar.svelte"
export let pubkey
const profile = deriveProfile(pubkey)
const profileDisplay = deriveProfileDisplay(pubkey)
2024-09-24 23:30:32 +00:00
const handle = deriveHandleForPubkey(pubkey)
2024-09-24 21:12:38 +00:00
</script>
2024-09-24 23:30:32 +00:00
<div class="flex gap-2 max-w-full">
2024-09-24 21:12:38 +00:00
<div class="py-1">
<Avatar src={$profile?.picture} size={10} />
</div>
2024-09-24 23:30:32 +00:00
<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>
2024-09-24 21:12:38 +00:00
</div>
</div>