Spaces:
Runtime error
Runtime error
File size: 596 Bytes
9e93b10 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | <script lang="ts">
import { copyToClipboard, unescapeHtml } from '$lib/utils';
import { toast } from 'svelte-sonner';
import { getContext } from 'svelte';
const i18n = getContext('i18n');
export let token;
export let done = true;
</script>
<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
<code
class="codespan cursor-pointer {!done ? 'fade-in-token' : ''}"
on:click={() => {
copyToClipboard(unescapeHtml(token.text));
toast.success($i18n.t('Copied to clipboard'));
}}>{unescapeHtml(token.text)}</code
>
|