<template>
  <div
    v-if="tools.visualizzaHomeApp()"
    class="row text-center justify-evenly items-center"
  >
    <div class="q-mb-sm">
      <q-btn
        icon="fas fa-upload"
        color="positive"
        size="md"
        rounded
        :label="$t('circuit.sendcoins_toso')"
        @click="clickInviaRIS"
        :push="showSendCoin"
      >
      </q-btn>
      &nbsp;
      <q-btn
        icon="fas fa-download"
        color="accent"
        size="md"
        rounded
        :label="$t('circuit.receive_coins')"
        @click="clickriceviRIS"
        :push="showReceiveCoin"
      >
      </q-btn>

      <q-slide-transition>
        <CTitleBanner
          v-show="showReceiveCoin"
          :class="`q-pa-xs `"
          :title="$t('circuit.receive_coins')"
          bgcolor="white"
          bgcolor2="lightblue"
          :clcolor="`text-indigo`"
          :canopen="true"
          :small="true"
          :open="true"
        >
          <q-banner
            v-show="riscallrec"
            rounded
            class="bg-blue text-white"
            style="text-align: center"
          >
            {{ riscallrec }}
            <br />
          </q-banner>

          <q-option-group
            class="q-ma-xs"
            style="text-align: left !important"
            v-model="receiveType"
            :options="optionsReceive"
            color="primary"
          />
          <q-tab-panels
            v-model="receiveType"
            animated
            keep-alive
            class="shadow-2 rounded-borders"
          >
            <q-tab-panel name="link">
              <div class="row justify-center">
                <div
                  class="q-ma-xs q-pa-xs"
                  v-html="t('circuit.compila_il_tuo_link_per_ricevere_ris')"
                ></div>

                <q-input
                  v-model="causal"
                  rounded
                  filled
                  maxlength="80"
                  counter
                  :label="$t('circuit.note_richiedente')"
                  class="q-ma-sm full-width q-px-xs"
                  autogrow
                  dense
                >
                  <template v-slot:prepend>
                    <q-icon name="description" class="q-mr-xs" />
                  </template>
                </q-input>

                <q-input
                  class="q-mb-sm text-h5"
                  style="width: 180px"
                  outlined
                  dense
                  v-model="qtyRIS"
                  :type="'number'"
                  @input="limitQuantity"
                  :label="t('circuit.quantita')"
                  input-class="text-right"
                  input-style="padding-bottom: 14px !important;"
                  v-on:keyup.enter="$event.target.nextElementSibling.focus()"
                >
                  <template v-slot:append>
                    <div class="text-h6">
                      <em
                        class="q-px-sm text-white rounded-borders"
                        style="background-color: #ff5500"
                        >RIS</em
                      >
                    </div>
                  </template>
                </q-input>
              </div>
              <CCopyBtnSmall :texttocopy="miolink" :small="true" :btn="true">
              </CCopyBtnSmall>
            </q-tab-panel>
            <q-tab-panel name="showonlist">
              <!--<q-btn
                v-if="!showonreclist"
                icon="fas fa-upload"
                color="positive"
                size="md"
                rounded
                :label="$t('circuit.addtothereceiverlist')"
                @click="clickAddtoRecList"
              >
              </q-btn>-->

              <q-slide-transition> </q-slide-transition>
            </q-tab-panel>
            <q-tab-panel name="qrcode">
              <CQRCode
                :read="false"
                textlink="Link Profilo"
                :link="userStore.getLinkProfileAndRIS('', '', '')"
              ></CQRCode>
            </q-tab-panel>
          </q-tab-panels>
        </CTitleBanner>
      </q-slide-transition>
      <!--<div class="q-mb-sm"></div>


      <CUserInfoAccount
        :user="contact"
        :circuitpath="circuitpath"
        :admin="false"
        :onlysaldo="true"
      />-->
    </div>
  </div>
  <div>
    <q-slide-transition>
      <CTitleBanner
        v-show="showSendCoin"
        :class="`q-pa-xs `"
        :title="$t('circuit.sendcoins')"
        bgcolor="white"
        bgcolor2="lightblue"
        :clcolor="`text-indigo`"
        :canopen="true"
        :small="true"
        :open="true"
      >
        <CFindUsers
          :actionType="costanti.ACTIONTYPE.SEND_RIS"
          :sendRIS="sendRIS"
        >
        </CFindUsers>
      </CTitleBanner>
    </q-slide-transition>
  </div>
</template>

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

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