flotilla/src/app/components/ClassifiedStatus.svelte

24 lines
553 B
Svelte
Raw Normal View History

2026-02-04 01:09:30 +00:00
<script lang="ts">
import type {TrustedEvent} from "@welshman/util"
2026-07-28 16:16:26 +00:00
import {Classified} from "@welshman/domain"
2026-02-04 01:09:30 +00:00
import {ucFirst} from "@lib/util"
import Badge from "@lib/components/Badge.svelte"
2026-07-28 16:16:26 +00:00
import {reader} from "@app/core"
2026-02-04 01:09:30 +00:00
type Props = {
event: TrustedEvent
}
const {event}: Props = $props()
2026-07-28 16:16:26 +00:00
const classified = reader(Classified)(event)
const status = classified.status()
2026-02-04 01:09:30 +00:00
</script>
{#if status}
<Badge variant={status !== "active" ? "primary" : "neutral"} class="rounded-full">
2026-02-04 01:09:30 +00:00
{ucFirst(status)}
</Badge>
2026-02-04 01:09:30 +00:00
{/if}