import Helpers from '@/helpers'
export default {
  computed: {
    getQualification() {
      return {
        current: Helpers.getValue(this.rankGoalData, 'rank.current.qualification_bv_current') || 0,
        goal: Helpers.getValue(this.rankGoalData, 'rank.next.qualification_bv') || 0,
      }
    },
    getActiveBv() {
      return {
        current: Helpers.getValue(this.rankGoalData, 'rank.current.active_bv') || 0,
        goal: Helpers.getValue(this.rankGoalData, 'rank.next.active_bv') || 0,
      }
    },
    getNextGoalRankZone() {
      let zoneName =
        Helpers.getValue(this.rankGoalData, 'rank.next.translated_zone_name.content') ||
        Helpers.getValue(this.rankGoalDta, 'rank.next.zone_name', 'N/A')
      let zoneLevel =
        Helpers.getValue(this.rankGoalData, 'rank.next.translated_level_name.content') ||
        Helpers.getValue(this.rankGoalData, 'rank.next.level_name', 'N/A')

      return (
        zoneLevel +
        (zoneName !== 'N/A' && zoneLevel !== 'N/A' && zoneName.trim() !== zoneLevel.trim() ? ' - ' + zoneName : '')
      )
    },
    getNextGoalRankQualificationAchievement() {
      return Helpers.getValue(this.rankGoalData, 'rank.next.qualification_bv_achieved') || false
    },
    getNextGoalRankActiveAchievement() {
      return Helpers.getValue(this.rankGoalData, 'rank.next.active_bv_achieved') || false
    },
    getCurrentBv() {
      return {
        left: Helpers.getValue(this.rankGoalData, 'pv.left') || 0,
        right: Helpers.getValue(this.rankGoalData, 'pv.right') || 0,
      }
    },
    // TODO: waiting for further instruction about the rank icon
    getRankGoalBadge() {
      return null
    },
  },
}
