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.
 
 
 
 
 

29 lines
737 B

<script lang="ts">
import { ndk } from '$lib/stores/ndk'
import type { NDKEvent } from '@nostr-dev-kit/ndk'
import EventCard from './EventCard.svelte'
import ThreadWrapper from '$lib/components/events/ThreadWrapper.svelte'
import { writable } from 'svelte/store'
export let event: NDKEvent
export let type: 'proposal' | 'issue' = 'proposal'
export let replies: NDKEvent[] | undefined = undefined
let replies_store = replies
? writable(replies)
: ndk.storeSubscribe({
'#e': [event.id],
})
$: {
if (replies) replies_store.set(replies)
}
</script>
<EventCard {type} {event} />
<ThreadWrapper>
{#each $replies_store as event}
<EventCard {type} {event} />
{/each}
</ThreadWrapper>