aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/Balance.svelte
blob: cc923b7d690af6daf7fcf575ab69ef2476735de2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<script>
	import { f, s, sat, sats } from '$lib/utils';
	import { animatedRate } from '$lib/store';
	import { t } from '$lib/translations';

	export let user;
</script>

<div class="space-y-2">
	<div class="text-5xl font-bold tabular-nums">
		{#if isNaN($animatedRate)}
			<div class="text-gray-200">&mdash;</div>
		{:else}
			{f((user.balance * $animatedRate) / sats, user.currency)}
		{/if}
	</div>

	<div class="text-secondary text-2xl">
		⚡️{s(user.balance)}
	</div>
</div>