blob: babcbfa06e62e616d3b318664b01b0b7a11985ae (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
<script lang="ts">
import {
STATUS_LABELS,
type RoutineStatus,
} from '$lib/shared/routine-metrics';
let {
status,
overdueDays = 0,
}: { status: RoutineStatus; overdueDays?: number } = $props();
const className = $derived(
status === 'ok'
? 'status bg-success text-white'
: status === 'due'
? 'status bg-accent-soft text-accent'
: status === 'late'
? 'status bg-accent text-white'
: 'status bg-danger text-white',
);
</script>
<span class={className}>
{STATUS_LABELS[status]}{#if overdueDays > 0}
({overdueDays} j){/if}
</span>
|