aboutsummaryrefslogtreecommitdiff
path: root/src/tools/text-to-nato-alphabet/text-to-nato-alphabet.vue
blob: aa551f5c8c5c606efe7311a512fdc3bc913f46df (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<template>
  <div>
    <n-form-item label="Your text to convert to NATO phonetic alphabet">
      <n-input v-model:value="input" placeholder="Put your text here..." clearable />
    </n-form-item>

    <n-space v-if="natoText" vertical>
      <n-text>Your text in NATO phonetic alphabet</n-text>
      <c-card>
        {{ natoText }}
      </c-card>

      <n-space justify="center">
        <c-button autofocus @click="copy"> Copy NATO string </c-button>
      </n-space>
    </n-space>
  </div>
</template>

<script setup lang="ts">
import { useCopy } from '@/composable/copy';
import { computed, ref } from 'vue';
import { textToNatoAlphabet } from './text-to-nato-alphabet.service';

const input = ref('');
const natoText = computed(() => textToNatoAlphabet({ text: input.value }));
const { copy } = useCopy({ source: natoText, text: 'NATO alphabet string copied.' });
</script>

<style lang="less" scoped></style>