import { defineComponent, onMounted, ref, computed } from 'vue'
import { tools } from '@tools'
import { useUserStore } from '@store/UserStore'
import { useRouter } from 'vue-router'
import { useGlobalStore } from '@store/globalStore'
import { useProducts } from '@store/Products'
import { useI18n } from 'vue-i18n'
import { toolsext } from '@store/Modules/toolsext'
import { useQuasar } from 'quasar'
import { costanti } from '@costanti'
import { ICart, IOrder, IOrderCart, IProduct, IShareWithUs } from '@src/model/Products'

import { shared_consts } from '@src/common/shared_vuejs'

import { CSingleCart } from '../../../components/CSingleCart'
import { CCart } from '../../../components/CCart'
import { CTitleBanner } from '@src/components/CTitleBanner'

export default defineComponent({
  name: 'checkOut',
  components: { CSingleCart, CTitleBanner, CCart },
  props: {},
  setup() {
    const userStore = useUserStore()
    const products = useProducts()
    const { t } = useI18n();
    const productStore = useProducts()

    const endload = ref(false)

    async function mounted() {
      // Inizializza
      await productStore.loadProducts(true)

      endload.value = true

    }

    onMounted(mounted)

    return {
      userStore,
      costanti,
      tools,
      toolsext,
      shared_consts,
      t,
      products,
      endload,
    }
  }
})
