File size: 459 Bytes
41a5ab2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<script lang="ts">
	import { Copy } from '@lucide/svelte';
	import { copyToClipboard } from '$lib/utils';

	interface Props {
		ariaLabel?: string;
		canCopy?: boolean;
		text: string;
	}

	let { ariaLabel = 'Copy to clipboard', canCopy = true, text }: Props = $props();
</script>

<Copy
	class="h-3 w-3 flex-shrink-0 cursor-{canCopy ? 'pointer' : 'not-allowed'}"
	aria-label={ariaLabel}
	onclick={() => canCopy && copyToClipboard(text)}
/>