import { defineComponent, onMounted, ref } from 'vue'

import { CMyPage } from '@src/components/CMyPage'
import { CGridTableRec } from '@src/components/CGridTableRec'
import { tools } from '@tools'
import { static_data } from '@src/db/static_data'

import { fieldsTable } from '@src/store/Modules/fieldsTable'
import { shared_consts } from '@src/common/shared_vuejs'

export default defineComponent({
  name: 'UsersList',
  components: { CGridTableRec, CMyPage },
  setup() {

    const arrfilterand: any = ref([])

    function mounted() {
      if (tools.appid() === tools.IDAPP_RISO) {
        arrfilterand.value = [
          {
            label: 'Attivi',
            value: shared_consts.FILTER_ATTIVI
          },
          {
            label: 'Nascosti',
            value: shared_consts.FILTER_NASCOSTI
          },
          {
            label: 'Non hanno l\'Invitante',
            value: shared_consts.FILTER_USER_NO_INVITANTE
          },
          {
            label: 'Segnalati',
            value: shared_consts.FILTER_REPORTED
          },
          {
            label: 'No Approv. Invitante',
            value: shared_consts.FILTER_USER_NO_VERIFIED_APORTADOR
          },
          {
            label: 'No Telegram ID',
            value: shared_consts.FILTER_USER_NO_TELEGRAM_ID
          },
          {
            label: 'SI Telegram ID',
            value: shared_consts.FILTER_USER_SI_TELEGRAM_ID
          },
          {
            label: 'NO Username Teleg',
            value: shared_consts.FILTER_USER_WITHOUT_USERNAME_TELEGRAM
          },
          {
            label: 'Verifica Teleg interrotta',
            value: shared_consts.FILTER_USER_CODICE_AUTH_TELEGRAM
          },
          {
            label: 'Email non Verificata',
            value: shared_consts.FILTER_USER_NO_EMAIL_VERIFICATA
          },
          {
            label: 'Telegram BOT Rimosso',
            value: shared_consts.FILTER_USER_TELEGRAM_BLOCKED
          },
          {
            label: 'Provincia',
            value: shared_consts.FILTER_USER_PROVINCE
          },
          {
            label: 'Senza Provincia',
            value: shared_consts.FILTER_USER_SENZA_PROVINCE
          },
        ]

      } else if (tools.appid() === tools.IDAPP_FREEPLANET) {
        arrfilterand.value = [
          {
            label: 'Attivi',
            value: shared_consts.FILTER_ATTIVI
          },
        ]
      }
    }

    function db_fieldsTable() {
      return fieldsTable
    }

    onMounted(mounted)

    return {
      arrfilterand,
      fieldsTable,
    }
  }
})


