~ knotless Search/
↑↓ move↵ open⇧↵ all results

johnandersen777.bsky.social/knotless

git that lives in your Atmosphere account

Forked from chadtmiller.com/knotless

0
0
18 lines · 1.1 KB Raw History
<script lang="ts">
	import type { MinutesView } from '#lib/lexicons/dev/knotless/defs.ts';
	import { date, number } from '#lib/format.ts';
	import Icon from '#lib/atoms/Icon.svelte';
	import Meter from '#lib/atoms/Meter.svelte';
	/** A runner's minutes for the owner once they near its allowance: how many are used, or that runs go one at a time past it, and when some free up. */
	let { m, allowance }: { m: MinutesView; allowance: number } = $props();
	const next = $derived(m.freeing?.[0]);
	const said = $derived(
		m.minutes >= allowance
			? `Past the ${number(allowance)}-minute allowance on ${m.runner.handle} (${number(m.minutes)} used in 30 days). Runs still finish, one at a time, until minutes age out${next ? `: about ${number(next.minutes)} by ${date(next.at)}` : ''}.`
			: `${number(m.minutes)} of ${number(allowance)} runner minutes used in the last 30 days on ${m.runner.handle}.${next ? ` About ${number(next.minutes)} free up by ${date(next.at)}.` : ''}`
	);
</script>

<div class="minutes-note">
	<Icon name="clock" /><span class="said">{said}</span><Meter used={m.minutes} of={allowance} />
</div>