aboutsummaryrefslogtreecommitdiff
path: root/src/lib/components/ScoreBadge.svelte
blob: 63846679b899f8c7f47f7fbf611ef9f8bcf5d8e5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13

<script lang="ts">
	let { score }: { score: number } = $props();

	const className = $derived(
		score >= 80
			? 'score bg-success'
			: score >= 50
				? 'score bg-accent'
				: 'score bg-danger',
	);
</script>

<span class={className}>{score}</span>