<template>
  <div>
    <template v-if="isMobile">
      <validationPhone-stepSelect v-if="step === 'first'" @stepEvent="setStep"/>
    </template>
    <template v-else>
      <accountCenter-header/>
      <phone-validation/>
    </template>
  </div>
</template>
<script>
  import AccountCenterHeader from '~components/default/AccountCenterHeader.vue'
  import PhoneValidation from '~components/validation/PhoneValidation.vue'
  import ValidationPhoneStepSelect from '~components/mobile/validation/ValidationPhoneStepSelect'
  export default {
    layout (context) {
      return context.store.state.option.isMobile ? 'mobile' : 'default'
    },
    transition: {
      name: 'fade',
      mode: 'out-in'
    },
    data () {
      return {
        step: 'first'
      }
    },
    components: {
      AccountCenterHeader,
      PhoneValidation,
      ValidationPhoneStepSelect
    },
    computed: {
      isMobile () {
        return this.$store.state.option.isMobile
      }
    },
    methods: {
      setStep (type) {
        this.step = type
      }
    }
  }
</script>
