<template>
  <div>
    <q-dialog v-model="show" :maximized="$q.screen.lt.sm" @hide="hide">
      <q-card class="dialog_card">
        <q-toolbar class="bg-primary text-white">
          <q-toolbar-title>
            {{ $t('circuit.sendcoins') }}
          </q-toolbar-title>
          <q-btn flat round color="white" icon="close" v-close-popup></q-btn>
        </q-toolbar>
        <q-card-section class="q-pa-xs inset-shadow">

          <q-select rounded outlined v-model="circuitsel" :options="bothcircuits" label="Circuito">
          </q-select>

          <q-input v-model="from_username" label="Mittente" class="full-width" disable>
          </q-input>
          <q-input v-model="to_user.username" label="Destinatario" class="full-width" disable>
          </q-input>
          <q-input v-model="causal" label="Note" class="full-width">
          </q-input>


          <q-input outlined v-model="qty" type="number"

                   label="Quantità"
                   :prefix="circuitloaded.symbol">
            <template v-slot:append>
              <q-avatar>
                <img src="https://cdn.quasar.dev/logo-v2/svg/logo.svg">
              </q-avatar>
            </template>
          </q-input>


        </q-card-section>
        <q-card-actions align="center">
          <q-btn
            :label="$t('circuit.sendcoinsto', {qty, coin: circuitsel, dest: to_user.username })" color="primary"
            @click="sendCoin()"></q-btn>
          <q-btn flat :label="$t('dialog.cancel')" color="primary" v-close-popup></q-btn>
        </q-card-actions>
      </q-card>
    </q-dialog>
  </div>
</template>

<script lang="ts" src="./CSendCoins.ts">
</script>

<style lang="scss" scoped>
@import './CSendCoins.scss';
</style>
