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

<div class="flex flex-col items-center">
	<svg width="36" height="36" viewBox="0 0 20 20" aria-hidden="true">
		<circle cx="10" cy="10" r="7" fill="none" stroke="var(--c-line)" stroke-width="2" />
		<circle
			class="fill-arc"
			cx="10"
			cy="10"
			r="7"
			fill="none"
			stroke="var(--c-accent)"
			stroke-width="2"
			stroke-linecap="round"
			transform="rotate(-90 10 10)"
			stroke-dasharray="{(percentage / 100) * 43.98} 43.98"
		/>
	</svg>
	<span
		class="block text-center font-sans text-xs font-bold {percentage > 0 ? 'text-primary' : 'text-gray-400'}"
	>
		{percentage}%
	</span>
</div>
