aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/Balance.svelte
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-02-02 23:26:34 -0800
committerAdam Soltys <[email protected]>2023-02-02 23:29:42 -0800
commit916f331e0e9a051830ce988639bb2149788e8228 (patch)
treea2dc51e4f16fab464788c54dd60e6c18dc8923b0 /src/components/Balance.svelte
parent8ebbc178b68da89470bac68f65a365bc6366747b (diff)
downloadcoinos-ui-916f331e0e9a051830ce988639bb2149788e8228.tar.gz
coinos-ui-916f331e0e9a051830ce988639bb2149788e8228.zip
move invoices, combine profile and dashboard
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>