17 lines
516 B
Svelte
17 lines
516 B
Svelte
<script lang="ts">
|
|
import { watchdogStateLabels, type WatchdogState } from '$lib/watchdog.js';
|
|
import Badge from './primitives/Badge.svelte';
|
|
let { state }: { state: WatchdogState } = $props();
|
|
const tone = $derived(
|
|
state === 'attention'
|
|
? 'warning'
|
|
: state === 'resolved'
|
|
? 'online'
|
|
: state === 'recovering'
|
|
? 'info'
|
|
: 'neutral'
|
|
);
|
|
</script>
|
|
|
|
<Badge variant={tone}>{watchdogStateLabels[state]}</Badge>
|