import { Component } from 'vue-property-decorator'

import { CMyPage } from '../../components/CMyPage/index'

import { tools } from '@src/store/Modules/tools'
import { Screen } from 'quasar'
import { CCopyBtn, CImgText, CTitleBanner } from '@components'
import MixinBase from '@src/mixins/mixin-base'
import { static_data } from '@src/db/static_data'
import { UserStore } from '@modules'

@Component({
  mixins: [MixinBase],
  components: { CMyPage, CTitleBanner, CImgText, CCopyBtn }
})
export default class Invite extends MixinBase {
  public $t: any
  public $q
  public msg: string = ''

  get static_data() {
    return static_data
  }

  public mymsg() {
    const messaggio = this.getValDbLang('MSG_SHARE', false, '')

    return tools.myprintf(messaggio, [{strin: 'linkreg', strout: this.getRefLink}])

    // return tools.myprintf(messaggio, [{
    //   videointro: static_data.costanti.videointro,
    //   paginaspiegazione: static_data.costanti.paginaspiegazione,
    //   linkzoom: tools.getLinkZoom()
    // }])

    // return this.$t('reg.msginvito', {
    //   videointro: tools.getlinkhref(static_data.costanti.videointro, this.$t('reg.videointro')),
    //   paginavideo: tools.getlinkhref(static_data.costanti.paginavideo, 'Video'),
    //   linkzoom: tools.getlinkhref(tools.getLinkZoom(), 'Zoom')
    // })
  }

  public copytoclip() {
    tools.copyStringToClipboard(this, this.mymsg(), false)
  }

  get getRefLink() {
    return UserStore.getters.getRefLink(UserStore.state.my.username)
  }


}
