forked from coracle/flotilla
Add classified status
This commit is contained in:
@@ -1,10 +1,17 @@
|
||||
<script lang="ts">
|
||||
import type {Snippet} from "svelte"
|
||||
import type {TrustedEvent} from "@welshman/util"
|
||||
import {PublishStatus} from "@welshman/net"
|
||||
import {deriveIsDeleted} from "@welshman/store"
|
||||
import {thunks, mergeThunks, repository} from "@welshman/app"
|
||||
import {thunks, mergeThunks, thunkHasStatus, repository} from "@welshman/app"
|
||||
import ThunkStatus from "@app/components/ThunkStatus.svelte"
|
||||
|
||||
const {event}: {event: TrustedEvent} = $props()
|
||||
type Props = {
|
||||
event: TrustedEvent
|
||||
children?: Snippet
|
||||
}
|
||||
|
||||
const {event, children}: Props = $props()
|
||||
|
||||
const deleted = deriveIsDeleted(repository, event)
|
||||
const thunk = $derived(mergeThunks($thunks.filter(t => t.event.id === event.id)))
|
||||
@@ -12,6 +19,8 @@
|
||||
|
||||
{#if $deleted}
|
||||
<div class="btn btn-error btn-xs rounded-full">Deleted</div>
|
||||
{:else if thunk}
|
||||
{:else if thunk.thunks.length > 0 && !thunkHasStatus(PublishStatus.Success, thunk)}
|
||||
<ThunkStatus {thunk} />
|
||||
{:else if children}
|
||||
{@render children?.()}
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user