<template>
  <q-card class="dialog_card">
    <q-toolbar class="bg-primary text-white">
      <q-toolbar-title> Modifica a {{ myproduct.productInfo.name }}</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">
      <div>
        <q-inner-loading
          id="spinner"
          :showing="loading"
        >
          <q-spinner-tail
            color="primary"
            size="4em"
          >
          </q-spinner-tail>
        </q-inner-loading>

        <q-tabs
          v-model="mytab"
          inline-label
          class="text-blue shadow-2"
        >
          <q-tab
            label="Scheda"
            name="scheda"
            icon="fas fa-file-alt"
          ></q-tab>
          <q-tab
            label="Descrizioni"
            name="descr"
            icon="fas fa-align-left"
          ></q-tab>
          <q-tab
            label="Statistiche"
            name="stat"
            icon="fas fa-stats"
          ></q-tab>
        </q-tabs>
        <q-tab-panels
          v-model="mytab"
          animated
        >
          <q-tab-panel name="scheda">
            <CTableCupleLabelValue
              :list="getArrListScheda()"
              @updateproductmodif="updateproductmodif"
            >
            </CTableCupleLabelValue>
          </q-tab-panel>
          <q-tab-panel name="descr">
            <CTableCupleLabelValue
              :list="getArrListDescrizioni()"
              @updateproductmodif="updateproductmodif"
            >
            </CTableCupleLabelValue>
          </q-tab-panel>
          <q-tab-panel name="stat">
            <CTableCupleLabelValue
              :list="getArrListStat()"
              @updateproductmodif="updateproductmodif"
            >
            </CTableCupleLabelValue>
          </q-tab-panel>
        </q-tab-panels>
      </div>
      <div class="">
        <q-btn
          rounded
          class="q-ma-sm"
          color="accent"
          icon="fas fa-save"
          label="Riaggiorna da GM"
          @click="refreshSingleBookFromGM({usaDBGMLocale: false})"
        ></q-btn>
        <q-btn
          rounded
          class="q-ma-sm"
          color="accent"
          icon="fas fa-save"
          label="Aggiorna su GM"
          :disabled="true"
          @click="updateRecordToGM"
        ></q-btn>
      </div>
    </q-card-section>
  </q-card>
</template>

<script lang="ts" src="./CSchedaProdotto.ts"></script>
<style lang="scss" scoped>
@import './CSchedaProdotto.scss';
</style>
