<script setup>

import { copyToClipboard } from '../utils';
import Button from './Button.vue';

const props = defineProps({
  value: String,
  doneHint: String,
});

function onClipboard() {
  copyToClipboard(props.value);
  window.pankow.notify({
    text: props.doneHint || 'Copied',
    type: 'success',
  });
}

</script>

<template>
  <i class="pankow-clipboard-action fa-solid fa-copy" @click="onClipboard()"></i>
</template>

<style>

.pankow-clipboard-action {
  cursor: copy;
}

.pankow-clipboard-action:hover {
  color: var(--pankow-color-dark);
}

</style>
