import { Progress } from "@kobalte/core"; import { SmallHeader } from "."; export default function formatNumber(num: number) { const map = [ { suffix: 'T', threshold: 1e12 }, { suffix: 'B', threshold: 1e9 }, { suffix: 'M', threshold: 1e6 }, { suffix: 'K', threshold: 1e3 }, { suffix: '', threshold: 1 }, ]; const found = map.find((x) => Math.abs(num) >= x.threshold); if (found) { const formatted = (num / found.threshold).toLocaleString() + found.suffix; return formatted; } return num.toLocaleString(); } export function ProgressBar(props: { value: number, max: number }) { return ( `${formatNumber(value)} of ${formatNumber(max)} sats sent`} class="w-full flex flex-col gap-2" >
Sending...
) }