Files
electric-cherry/src/lib/ui/components/WatchdogStatus.svelte
T

9 lines
418 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>