<script setup lang="ts">
import { copyToClipboard } from '@/utils';
import { ClipboardIcon } from '@heroicons/vue/24/outline';


interface Props {
    value?: string;
}
const props = defineProps<Props>();

const doCopy = () => {
    if (!props.value) {
        return;
    }
    copyToClipboard(props.value);
}
</script>

<template>
    <button class="btn-icon" title="Copy to clipboard" @click="doCopy">
        <ClipboardIcon />
    </button>
</template>