2024-09-24 21:12:38 +00:00
|
|
|
<script lang="ts">
|
2024-10-01 23:27:25 +00:00
|
|
|
import {nip19} from 'nostr-tools'
|
|
|
|
|
import {ctx} from "@welshman/lib"
|
2024-09-24 21:12:38 +00:00
|
|
|
import {displayPubkey} from "@welshman/util"
|
|
|
|
|
import {deriveProfile, deriveProfileDisplay, formatTimestamp} from "@welshman/app"
|
2024-10-01 23:27:25 +00:00
|
|
|
import Link from "@lib/components/Link.svelte"
|
2024-09-24 21:12:38 +00:00
|
|
|
import Avatar from "@lib/components/Avatar.svelte"
|
|
|
|
|
import Profile from "@app/components/Profile.svelte"
|
2024-10-01 23:27:25 +00:00
|
|
|
import {entityLink} from '@app/state'
|
2024-09-24 21:12:38 +00:00
|
|
|
|
|
|
|
|
export let event
|
2024-10-01 23:27:25 +00:00
|
|
|
|
|
|
|
|
const relays = ctx.app.router.Event(event).getUrls()
|
|
|
|
|
const nevent = nip19.neventEncode({id: event.id, relays})
|
2024-09-24 21:12:38 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<div class="flex flex-col gap-2 {$$props.class}">
|
|
|
|
|
<div class="flex justify-between gap-2">
|
|
|
|
|
<Profile pubkey={event.pubkey} />
|
2024-10-01 23:27:25 +00:00
|
|
|
<Link external href={entityLink(nevent)} class="text-sm opacity-75">
|
|
|
|
|
{formatTimestamp(event.created_at)}
|
|
|
|
|
</Link>
|
2024-09-24 21:12:38 +00:00
|
|
|
</div>
|
|
|
|
|
<slot />
|
|
|
|
|
</div>
|