You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.3 KiB
33 lines
1.3 KiB
<script lang="ts"> |
|
import EventWrapper from "$lib/components/events/EventWrapper.svelte"; |
|
import Kind19851985 from "$lib/components/events/content/Kind19851985.svelte"; |
|
import Kind317 from "$lib/components/events/content/Kind317.svelte"; |
|
import ParsedContent from "$lib/components/events/content/ParsedContent.svelte"; |
|
import type { User } from "$lib/components/users/type"; |
|
import { defaults as user_defaults } from "$lib/components/users/type"; |
|
import { patch_kind, pr_status_kind } from "$lib/kinds"; |
|
import { ensureUser } from "$lib/stores/users"; |
|
import type { NDKEvent } from "@nostr-dev-kit/ndk"; |
|
import { onDestroy } from "svelte"; |
|
import { writable } from "svelte/store"; |
|
|
|
export let event: NDKEvent; |
|
|
|
let author = writable({ ...user_defaults }); |
|
let author_unsubsriber = ensureUser(event.pubkey).subscribe((u) => { |
|
author.set({ ...u }); |
|
}); |
|
onDestroy(() => { |
|
author_unsubsriber(); |
|
}); |
|
</script> |
|
|
|
<EventWrapper author={$author} created_at={event.created_at}> |
|
{#if event.kind == patch_kind} |
|
<Kind317 content={event.content} tags={event.tags} /> |
|
{:else if event.kind === pr_status_kind} |
|
<Kind19851985 tags={event.tags} /> |
|
{:else} |
|
<ParsedContent content={event.content} tags={event.tags} /> |
|
{/if} |
|
</EventWrapper>
|
|
|