<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-surface-secondary text-secondary p-2 font-mono text-sm whitespace-pre-wrap my-2 rounded-md"
	>{content} <span on:click={() => copyToClipboard(content)} class="cursor-pointer ml-2"
		><Icon data={faClipboard} /></span
	></pre
>
