<script setup lang="ts">
import { useClipboard } from '@vueuse/core';

const props = defineProps<{
    link: string;
}>();

const { copy, copied } = useClipboard({ source: props.link });
</script>

<template>
    <button type="button" :class="['btn', copied ? 'btn-success' : 'btn-outline-primary', 'm-1']" @click="copy()">
        <Icon :v="copied ? 'clipboard-check' : 'clipboard'" />
        <T>crud.copy</T>
    </button>
</template>
