<template>
  <div>
    <div class="text-left mb-1">Meu Cadastro: </div>
    <div v-if="profileData =! null" class="profile-card px-2 pt-3 pb-0">
      <b-form>
        <b-form-row class="custom-form-row">
          <b-form-group class="col-md-12">
            <text-input :textInput="user.name"
              title="Nome Completo:"
              place-holder="Maria Fernanda"
              :disabled="true"
            />
          </b-form-group>
        </b-form-row>

        <b-form-row class="custom-form-row">
          <b-form-group class="col-md-6 col-sm-12">
            <cpf title="CPF:" :disabled="true" :cpf="profileData.cpf"  />
          </b-form-group>
          <b-form-group class="col-md-6 col-sm-12">
           <date-input :currentDate="birthDate"
              
              :disabled="true"
            />
          </b-form-group>
        </b-form-row>

        <b-form-row class="custom-form-row">
          <b-form-group class="col-md-6 col-sm-12">
            <text-input title="RG" :disabled="true" :textInput="profileData.rg" />
          </b-form-group>
          <b-form-group class="col-md-6 col-sm-12">
            <div class="text-left label akkurat-regular">
              <label for="gov-agency">
                Orgão Emissor:
              </label>
            </div>
            <the-mask
              id="gov-agency"
              type="text"
              class="form-control radius-theme akkurat-regular"
              mask="SSO/GO"
              placeholder="SSO/GO"
              :disabled="true"
              :value="profileData.rg_emissor"
            />
          </b-form-group>
        </b-form-row>
      </b-form>
    </div>
  </div>
</template>

<script>
import Cpf from '@/components/shared-components/inputs/Cpf.vue';
import TextInput from '@/components/shared-components/inputs/TextInput.vue';
import NumberInput from '@/components/shared-components/inputs/NumberInput.vue';
import DateInput from '@/components/shared-components/inputs/DateInput.vue';

export default {
  name: 'my-register',
  components: {
    Cpf,
    TextInput,
    DateInput,
    NumberInput,
  },
  data: () => ({
    profileDatas: null
  }),
    computed:{
    birthDate:{
      get(){

if(this.profileData == null){
return "";
}

        return "";//this.$options.filters.formatDDMMAAAA(this.profileData.birthday);
      }
    },
    user:{

      get(){
        let user = Object.assign(this.$store.state.user.user);
        return user;
      },
      set(value){

      }
      
    },
    profileData: {
      get(){
var user = Object.assign(this.$store.state.user.user); 
       
        if(this.$store.getters.isSalesConsultant || this.$store.getters.isPromoter){

          return Object.assign(user.sales_consultant);
        }else{

        return user.manager_sales_consultant;
        }

      },
      set(value){

      }
    }
    },
    methods:{
      setProfileData(){
        
      }
    },

    mounted(){
      this.setProfileData();
    }
  
};
</script>

<style scoped lang="scss">
@import '../../assets/css/main.scss';
@import '../../assets/css/cards.scss';
</style>
