aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/Balance.svelte
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/Balance.svelte')
-rw-r--r--src/components/Balance.svelte19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/components/Balance.svelte b/src/components/Balance.svelte
new file mode 100644
index 00000000..5d72bd45
--- /dev/null
+++ b/src/components/Balance.svelte
@@ -0,0 +1,19 @@
+<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">
+ {$animatedRate
+ ? f((user.balance * $animatedRate) / sats, user.currency)
+ : $t('user.dashboard.fetchingRate')}
+ </div>
+
+ <div class="text-secondary text-2xl">
+ ⚡️{s(user.balance)}
+ </div>
+</div>