1<script lang="ts">
2 import { Copy } from '@lucide/svelte';
3 import { copyToClipboard } from '$lib/utils';
4
5 interface Props {
6 ariaLabel?: string;
7 canCopy?: boolean;
8 text: string;
9 }
10
11 let { ariaLabel = 'Copy to clipboard', canCopy = true, text }: Props = $props();
12</script>
13
14<Copy
15 class="h-3 w-3 flex-shrink-0 cursor-{canCopy ? 'pointer' : 'not-allowed'}"
16 aria-label={ariaLabel}
17 onclick={() => canCopy && copyToClipboard(text)}
18/>