|
|
|
|
@ -2,7 +2,11 @@
@@ -2,7 +2,11 @@
|
|
|
|
|
import InlineProfile from "$components/util/InlineProfile.svelte"; |
|
|
|
|
import CardActions from "$components/util/CardActions.svelte"; |
|
|
|
|
import Interactions from "$components/util/Interactions.svelte"; |
|
|
|
|
import { P } from "flowbite-svelte"; |
|
|
|
|
|
|
|
|
|
// isModal |
|
|
|
|
// - don't show interactions in modal view |
|
|
|
|
// - don't show all the details when _not_ in modal view |
|
|
|
|
let { event, isModal = false } = $props(); |
|
|
|
|
|
|
|
|
|
let title: string = $derived(event.getMatchingTags('title')[0]?.[1]); |
|
|
|
|
@ -18,18 +22,26 @@
@@ -18,18 +22,26 @@
|
|
|
|
|
let identifier: string = $derived(event.getMatchingTags('i')[0]?.[1] ?? null); |
|
|
|
|
let hashtags: [] = $derived(event.getMatchingTags('t') ?? []); |
|
|
|
|
let rootId: string = $derived(event.getMatchingTags('d')[0]?.[1] ?? null); |
|
|
|
|
let kind = $derived(event.kind); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="flex flex-row relative"> |
|
|
|
|
<div class="flex flex-col relative mb-2"> |
|
|
|
|
{#if !isModal} |
|
|
|
|
<div class="flex flex-row justify-between items-center"> |
|
|
|
|
<P class='text-base font-normal'><InlineProfile pubkey={event.pubkey} /></P> |
|
|
|
|
<CardActions event={event}></CardActions> |
|
|
|
|
</div> |
|
|
|
|
{/if} |
|
|
|
|
<div class="flex-grow grid grid-cols-1 md:grid-cols-[auto_1fr] gap-4 items-center"> |
|
|
|
|
{#if image} |
|
|
|
|
<div> |
|
|
|
|
<div class="my-2"> |
|
|
|
|
<img class="w-full md:max-w-48 object-contain rounded" alt={title} src={image} /> |
|
|
|
|
</div> |
|
|
|
|
{/if} |
|
|
|
|
<div class="space-y-4 {!image && !isModal ? 'mt-8' : ''}"> |
|
|
|
|
<div class="space-y-4 my-4"> |
|
|
|
|
<h1 class="text-3xl font-bold">{title}</h1> |
|
|
|
|
<h2 class="text-base font-bold"> |
|
|
|
|
by |
|
|
|
|
@ -39,14 +51,11 @@
@@ -39,14 +51,11 @@
|
|
|
|
|
{author} |
|
|
|
|
{/if} |
|
|
|
|
</h2> |
|
|
|
|
{#if version !== '1' } |
|
|
|
|
<h4 class="text-base font-thin">Version: {version}</h4> |
|
|
|
|
{/if} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
{#if !isModal} |
|
|
|
|
<div class="absolute right-0 sm:relative sm:flex sm:flex-col space-y-4"> |
|
|
|
|
<CardActions event={event}></CardActions> |
|
|
|
|
</div> |
|
|
|
|
{/if} |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
{#if summary} |
|
|
|
|
@ -63,11 +72,20 @@
@@ -63,11 +72,20 @@
|
|
|
|
|
</div> |
|
|
|
|
{/if} |
|
|
|
|
|
|
|
|
|
<div class="flex flex-row my-4"> |
|
|
|
|
<h4 class='text-base font-normal mt-2'>Index author: <InlineProfile pubkey={event.pubkey} /></h4> |
|
|
|
|
</div> |
|
|
|
|
{#if isModal} |
|
|
|
|
<div class="flex flex-row my-4"> |
|
|
|
|
<h4 class='text-base font-normal mt-2'> |
|
|
|
|
{#if kind === 30040} |
|
|
|
|
<span>Index author:</span> |
|
|
|
|
{:else} |
|
|
|
|
<span>Author:</span> |
|
|
|
|
{/if} |
|
|
|
|
<InlineProfile pubkey={event.pubkey} /> |
|
|
|
|
</h4> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="flex flex-col pb-4 space-y-1"> |
|
|
|
|
<div class="flex flex-col pb-4 space-y-1"> |
|
|
|
|
{#if source !== null} |
|
|
|
|
<h5 class="text-sm">Source: <a class="underline break-all" href={source} target="_blank">{source}</a></h5> |
|
|
|
|
{/if} |
|
|
|
|
@ -83,8 +101,8 @@
@@ -83,8 +101,8 @@
|
|
|
|
|
{#if identifier !== null} |
|
|
|
|
<h5 class="text-sm">{identifier}</h5> |
|
|
|
|
{/if} |
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
{/if} |
|
|
|
|
|
|
|
|
|
{#if !isModal} |
|
|
|
|
<Interactions event={event} rootId={rootId} direction="row"/> |
|
|
|
|
|