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

import { tools } from '@src/store/Modules/tools'
import { CSkill } from '@src/components/CSkill'
import { CMainView } from '@src/components/CMainView'
import { CDashboard } from '@src/components/CDashboard'
import { LandingFooter } from '@src/components/LandingFooter'
import { CUserNonVerif } from '@src/components/CUserNonVerif'
import { CStatusReg } from '@src/components/CStatusReg'
import { CCopyBtn } from '@src/components/CCopyBtn'
import { CCheckIfIsLogged } from '@src/components/CCheckIfIsLogged'
import { CMapsEsempio } from '@src/components/CMapsEsempio'
import { CEventsCalendar } from '@src/components/CEventsCalendar'
import { useGlobalStore } from '@store/globalStore'
import { useUserStore } from '@store/UserStore'
import { static_data } from '@src/db/static_data'
import { useNotifStore } from '@store/NotifStore'
import { CNotifAtTop } from '@src/components/CNotifAtTop'
import { CMyPageElem } from '@src/components/CMyPageElem'

import MixinBase from '@src/mixins/mixin-base'
import MixinUsers from '@src/mixins/mixin-users'
import { shared_consts } from '@src/common/shared_vuejs'
import { CPresentazione } from '@src/components'
import MixinMetaTags from '@src/mixins/mixin-metatags'
export default defineComponent({
  name: 'mainview',
  components: {
    CSkill, CMapsEsempio, CDashboard, CUserNonVerif, CMainView, CCopyBtn,
    CNotifAtTop, LandingFooter,
    CCheckIfIsLogged, CStatusReg, CEventsCalendar, CPresentazione, CMyPageElem
  },
  setup() {
    const globalStore = useGlobalStore()
    const userStore = useUserStore()
    const { getValDb } = MixinBase()
    const notifStore = useNotifStore()

    const isfinishLoading = computed(() => globalStore.finishLoading)

    const { setmeta } = MixinMetaTags()

    const { getRefLink } = MixinUsers()

    return {
      tools,
      static_data,
      getRefLink,
      userStore,
      shared_consts,
      globalStore,
      setmeta,
      getValDb,
      notifStore,
      isfinishLoading,
    }
  },
})
