﻿<template>
  <div class="card dialog">
    <div class="card-title">
      {{ t('title') }}
    </div>

    <div class="card-content">
      <v-text-field
          variant="outlined"
          v-model="address"
          :label="t('label')"
      ></v-text-field>
    </div>

    <div class="card-actions">
      <button class="secondary" @click="requestClose">
        {{ t('cancel') }}
      </button>
      <button class="primary" @click="requestSave">
        {{ t('save') }}
      </button>
    </div>
  </div>
</template>

<script setup>
import {ref} from 'vue';
import { useTranslations } from "@/translations/translations";

const t = useTranslations();
const props = defineProps(['address'])
const emit = defineEmits(['close', 'save'])

const address = ref(props.address);

const requestClose = () => emit('close')
const requestSave = () => emit('save', address.value)
</script>
