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

import { CImgText } from '../../../components/CImgText/index'
import { CCard } from '@src/components/CCard'
import { CMyPage } from '@src/components/CMyPage'
import { CTitleBanner } from '@src/components/CTitleBanner'
import { CGridTableRec } from '@src/components/CGridTableRec'

import { colmsg_templates } from '@src/store/Modules/fieldsTable'
import { useGlobalStore } from '@store/globalStore'
import MixinMetaTags from '@src/mixins/mixin-metatags'

export default defineComponent({
  name: 'Msgtemplate',
  components: { CImgText, CCard, CMyPage, CTitleBanner, CGridTableRec },
  setup() {
    const globalStore = useGlobalStore()

    const dataMsg_Templates = ref([])

    const { setmeta } = MixinMetaTags()

    async function mounted() {
      dataMsg_Templates.value = await globalStore.GetMsgTemplates()
    }

    onMounted(mounted)

    return {
      colmsg_templates,
      dataMsg_Templates,
      setmeta,
    }
  }
})
