<script lang="ts">
	interface Props {
		seconds?: number;
	}
	let { seconds }: Props = $props();

	function fmt(s: number): string {
		const m = Math.floor(s / 60);
		const r = s - m * 60;
		return `${m}:${r.toFixed(1).padStart(4, '0')}`;
	}
</script>

{#if seconds === undefined || !Number.isFinite(seconds)}
	<span class="font-mono text-xs text-muted-foreground/40">—</span>
{:else}
	<span class="font-mono text-xs text-foreground tabular-nums">{fmt(seconds)}</span>
{/if}
