<template>
  <q-page class="">

    <!--<CChartMap
      title="Mappa"
      subtitle="cartina..."
      serie1="Serie 1"
    >

    </CChartMap>-->

    <!--<CMapsEsempio></CMapsEsempio>-->


    <div v-if="isLogged()">
      <CVerifyTelegram v-if="!TelegVerificato()">

      </CVerifyTelegram>

      <CVerifyEmail v-if="!isEmailVerified() && !TelegVerificato()">

      </CVerifyEmail>

      <div v-if="isUserOk()">

        <CMainView></CMainView>

        <CDashboard></CDashboard>

        <CCopyBtn v-if="userStore.my.username" :title="$t('reg.link_reg')" :texttocopy="getRefLink(userStore.my.username)">

        </CCopyBtn>

        <div>Versione: {{tools.getvers()}}</div>

      </div>
      <div v-else>
        <CUserNonVerif></CUserNonVerif>
      </div>

    </div>
    <div v-else>
      <div class="q-pa-md q-gutter-sm">
        <q-banner rounded class="bg-primary text-white">
          <div class="text-h6 text-center">
            Accedi al menu inserendo le tue credenziali 🔑<br><br>
            📝 Non sei <strong>Registrato</strong>?<br>
            👉🏻 Chiedi in chat il link a chi ti ha <strong>invitato</strong>.<br>
          </div>
          <template v-slot:action>
            <q-btn flat color="white" label="Accedi al Login" @click="openrighttoolbar"/>
          </template>
        </q-banner>
      </div>

      <div
        v-if="!isLogged() && static_data.functionality.ENABLE_REGISTRATION && static_data.functionality.SHOW_REG_BUTTON"
        style="margin:20px; text-align: center;">
        <q-btn rounded size="lg" color="primary" @click="openrighttoolbar">{{ $t('login.enter') }}
        </q-btn>
      </div>

      <!--
                <div v-if="!isLogged && static_data.functionality.ENABLE_REGISTRATION" align="center" style="margin:20px;">
                  <q-btn rounded size="lg" color="primary" to="/signup">{{$t('reg.submit')}}
                  </q-btn>
                </div>
      -->

    </div>

  </q-page>

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