Files
windmill/frontend/src/lib/components/InlineCodeCopy.svelte
T
2023-04-02 13:52:15 +02:00

15 lines
482 B
Svelte

<script lang="ts">
import { copyToClipboard } from '$lib/utils'
import { faClipboard } from '@fortawesome/free-solid-svg-icons'
import { Icon } from 'svelte-awesome'
export let content: string
</script>
<!-- svelte-ignore a11y-click-events-have-key-events -->
<pre class="bg-gray-700 text-gray-100 p-2 font-mono text-sm whitespace-pre-wrap"
>{content} <span on:click={() => copyToClipboard(content)} class="cursor-pointer ml-2"
><Icon data={faClipboard} /></span
></pre
>