2 changed files with 27 additions and 1 deletions
@ -0,0 +1,23 @@ |
|||||||
|
<script lang="ts"> |
||||||
|
import type { NDKTag } from "@nostr-dev-kit/ndk"; |
||||||
|
import Status from "$lib/components/prs/Status.svelte"; |
||||||
|
|
||||||
|
export let tags: NDKTag[] = []; |
||||||
|
|
||||||
|
function extractTagContent(name: string): string | undefined { |
||||||
|
let tag = tags.find((tag) => tag[0] === name); |
||||||
|
return tag ? tag[1] : undefined; |
||||||
|
} |
||||||
|
let status: string | undefined; |
||||||
|
$: { |
||||||
|
status = extractTagContent("t"); |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<div class=""> |
||||||
|
{#if status} |
||||||
|
set status to <Status {status} /> |
||||||
|
{:else} |
||||||
|
set status incorrectly |
||||||
|
{/if} |
||||||
|
</div> |
||||||
Loading…
Reference in new issue