import { AgreementsInterface, Agreement, AppAreas } from '..'
import Vue from 'vue'
import Const from '@/config/const'

export default class Default implements AgreementsInterface {
  appArea: AppAreas = 'subscription'

  processAgreement(
    rootState: any,
    rootGetters: any,
    country: string,
    links: { [p: string]: string }
  ): Agreement | null {
    let agreement: Agreement = {
      name: 'subscription',
      messages: [
        Vue.i18n.translate('Eshop.Order.GlobalWords.Subscription', {
          link: `<a target='_blank' href='${links['termsOfAgreement']}'>${Vue.i18n.translate(
            'Enrolment.Agreement.toa.Title'
          )}</a>`,
          website: `<a target='_blank' href='${Const.constLinks.COMPANY_SITE.value}'>${Const.constLinks.COMPANY_SITE.text}</a>`,
        })!,
        Vue.i18n.translate('Eshop.Order.GlobalWords.IAgreeToElkenGlobal', {
          link: `<a target='_blank' href='${links['rulesAndRegulations']}'>${Vue.i18n.translate(
            'Eshop.Order.GlobalWords.RulesAndRegulations'
          )}</a>`,
        })!,
      ],
    }

    return agreement
  }
}
