mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-08 13:34:30 +02:00
23 lines
711 B
Vue
23 lines
711 B
Vue
<script setup>
|
|
import { useNotify } from '@2fauth/ui'
|
|
import { useI18n } from 'vue-i18n'
|
|
const { t } = useI18n()
|
|
|
|
const notify = useNotify()
|
|
const { copy } = useClipboard({ legacy: true })
|
|
|
|
const props = defineProps({
|
|
token: String,
|
|
})
|
|
|
|
function copyToClipboard() {
|
|
copy(props.token)
|
|
notify.success({ text: t('message.copied_to_clipboard') })
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<button type="button" :aria-label="$t('message.copy_to_clipboard')" :title="$t('message.copy_to_clipboard')" class="button is-like-text is-pulled-right is-small is-text" @click.stop="copyToClipboard()">
|
|
<FontAwesomeIcon :icon="['fas', 'copy']" />
|
|
</button>
|
|
</template> |