aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/InvoiceActions.svelte
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-11-05 00:10:30 -0800
committerAdam Soltys <[email protected]>2024-11-05 00:10:30 -0800
commit674de46a6a9f1b793313b5c027a34d396217ed84 (patch)
tree1000b455727ac54e78e0cdeee72e9e2b63257198 /src/components/InvoiceActions.svelte
parent4ef5028356e566220e9f1588757800db8a739aed (diff)
downloadcoinos-ui-674de46a6a9f1b793313b5c027a34d396217ed84.tar.gz
coinos-ui-674de46a6a9f1b793313b5c027a34d396217ed84.zip
dark styles
Diffstat (limited to 'src/components/InvoiceActions.svelte')
-rw-r--r--src/components/InvoiceActions.svelte50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/components/InvoiceActions.svelte b/src/components/InvoiceActions.svelte
new file mode 100644
index 00000000..47dbffbb
--- /dev/null
+++ b/src/components/InvoiceActions.svelte
@@ -0,0 +1,50 @@
+<script>
+ export let user,
+ invoice,
+ copy,
+ t,
+ link,
+ type,
+ types,
+ showQr,
+ txt,
+ toggleAmount;
+</script>
+
+<div class="text-secondary space-y-2 text-xl pt-2">
+ <button type="button" class="btn" on:click={() => copy(txt)}>
+ <iconify-icon icon="ph:copy-bold" width="32" />
+ <div class="my-auto">
+ {t("payments.copy")}
+ </div>
+ </button>
+
+ {#if user?.id === invoice?.user?.id}
+ <button class="btn" on:click={toggleAmount}>
+ <iconify-icon icon="ph:pencil-simple-bold" width="32" />
+ <div class="my-auto">{t("payments.setAmount")}</div>
+ </button>
+ {:else}
+ <a href={link} class="w-full">
+ <button class="btn">
+ <iconify-icon icon="ph:wallet-bold" width="32" />
+ <div class="my-auto">{t("payments.openLink")}</div>
+ </button>
+ </a>
+ {/if}
+
+ {#if txt.startsWith("ln")}
+ <div class="w-full flex justify-center gap-2 flex-wrap">
+ <button class="btn" on:click={() => (showQr = !showQr)}>
+ {#if showQr}
+ <iconify-icon icon="ph:text-align-center-bold" width="32" />
+ {:else}
+ <iconify-icon icon="ph:qr-code-bold" width="32" />
+ {/if}
+ <div class="my-auto">
+ {showQr ? t("payments.showText") : t("payments.showQr")}
+ </div></button
+ >
+ </div>
+ {/if}
+</div>