mirror of
https://github.com/aljazceru/hypergolic.git
synced 2026-02-06 06:04:22 +01:00
problem: buying products doesn't work without WebLN
This commit is contained in:
25
src/components/CopyButton.svelte
Normal file
25
src/components/CopyButton.svelte
Normal 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>
|
||||
Reference in New Issue
Block a user