2023-05-28 23:13:24 +02:00
|
|
|
<script setup lang="ts">
|
2023-08-22 01:00:20 +02:00
|
|
|
import { useCopy } from '@/composable/copy';
|
2023-05-28 23:13:24 +02:00
|
|
|
|
|
|
|
const props = defineProps<{ tokens: { previous: string; current: string; next: string } }>();
|
2023-08-22 01:00:20 +02:00
|
|
|
const { copy: copyPrevious, isJustCopied: previousCopied } = useCopy({ createToast: false });
|
|
|
|
const { copy: copyCurrent, isJustCopied: currentCopied } = useCopy({ createToast: false });
|
|
|
|
const { copy: copyNext, isJustCopied: nextCopied } = useCopy({ createToast: false });
|
2023-05-28 23:13:24 +02:00
|
|
|
|
|
|
|
const { tokens } = toRefs(props);
|
|
|
|
</script>
|
|
|
|
|
2022-08-24 00:10:53 +02:00
|
|
|
<template>
|
|
|
|
<div>
|
2023-10-14 18:24:54 +02:00
|
|
|
<div mb-5px w-full flex items-center>
|
2023-05-28 23:13:24 +02:00
|
|
|
<div flex-1 text-left>
|
|
|
|
Previous
|
|
|
|
</div>
|
|
|
|
<div flex-1 text-center>
|
|
|
|
Current OTP
|
|
|
|
</div>
|
|
|
|
<div flex-1 text-right>
|
|
|
|
Next
|
|
|
|
</div>
|
2023-05-27 17:36:15 +02:00
|
|
|
</div>
|
2023-10-14 18:24:54 +02:00
|
|
|
<div flex items-center>
|
|
|
|
<c-tooltip :tooltip="previousCopied ? 'Copied !' : 'Copy previous OTP'" position="bottom" flex-1>
|
|
|
|
<c-button data-test-id="previous-otp" w-full important:h-12 important:rounded-r-none important:font-mono @click.prevent="copyPrevious(tokens.previous)">
|
|
|
|
{{ tokens.previous }}
|
|
|
|
</c-button>
|
|
|
|
</c-tooltip>
|
|
|
|
<c-tooltip :tooltip="currentCopied ? 'Copied !' : 'Copy current OTP'" position="bottom" flex-1 flex-basis-5xl>
|
|
|
|
<c-button
|
|
|
|
data-test-id="current-otp" w-full important:border-x="1px solid gray op-40" important:h-12 important:rounded-0 important:text-22px @click.prevent="copyCurrent(tokens.current)"
|
|
|
|
>
|
|
|
|
{{ tokens.current }}
|
|
|
|
</c-button>
|
|
|
|
</c-tooltip>
|
|
|
|
<c-tooltip :tooltip="nextCopied ? 'Copied !' : 'Copy next OTP'" position="bottom" flex-1>
|
|
|
|
<c-button data-test-id="next-otp" w-full important:h-12 important:rounded-l-none @click.prevent="copyNext(tokens.next)">
|
|
|
|
{{ tokens.next }}
|
|
|
|
</c-button>
|
|
|
|
</c-tooltip>
|
|
|
|
</div>
|
2022-08-24 00:10:53 +02:00
|
|
|
</div>
|
|
|
|
</template>
|