problem: buying products doesn't work without WebLN

This commit is contained in:
Bob
2024-08-01 18:13:05 +08:00
parent 47f2e1666c
commit b187c7cc24
5 changed files with 1061 additions and 21 deletions

View File

@@ -0,0 +1,25 @@
<script lang="ts">
import { Button } from '$lib/components/ui/button/index.js';
import { Check, Copy } from 'lucide-svelte';
export let text;
let copyed: boolean;
</script>
<Button
on:click={() => {
if (text && navigator.clipboard) {
navigator.clipboard.writeText(text);
copyed = true;
setTimeout(() => {
copyed = false;
}, 2000);
}
}}
>
{#if copyed}
<Check class="h-5 w-5" />
{:else}
<Copy class="h-5 w-5" />
{/if}
</Button>