import { LOGGED_IN_USER, SELECTED_COUNTRY } from '../../utils/localStorageKeys'

export default {
  getGenealogyCountryId: state => {
    if (localStorage.getItem(SELECTED_COUNTRY) !== null) {
      return JSON.parse(localStorage.getItem(SELECTED_COUNTRY)).id
    }
  },
  getGenealogyUserId: state => {
    if (localStorage.getItem(LOGGED_IN_USER) !== null) {
      return JSON.parse(localStorage.getItem(LOGGED_IN_USER)).id
    }
  },
  getGenealogyUserName: state => {
    if (localStorage.getItem(LOGGED_IN_USER) !== null) {
      return JSON.parse(localStorage.getItem(LOGGED_IN_USER)).name
    }
  },
  getSponsorDownlineListing: state => {
    return state.genealogySponsorDownlineListing
  },
  getSponsorNetworkTree: state => {
    return state.genealogySponsorNetworkTree
  },
  getGenealogyMemberList: state => {
    return state.genealogyMemberList
  },
  getPlacementNetworkPerformance: state => {
    return state.genealogyPlacementNetworkPerformance
  },
  getMemberTreeDataTemp: state => {
    return state.memberTreeGenealogy
  },
  getMemberSearchGenealogy: state => {
    return state.searchMemberGenealogy
  },
  getGenealogyErrorMessage: state => {
    return state.genealogyErrorMsg
  },
}
