text: import Vue from 'vue'
  import Vuex from 'vuex'
  
  import jwt_decode from "jwt-decode";
  import { enums } from "@/utils";
  
  Vue.use(Vuex)
  
  const store = new Vuex.Store({
    modules: {
    },
    state: {
      userData: null,
      isLoading: false,
      isUserDataLoading: false
    },
    actions: {
      SET_USER_DATA: async function ({ commit }) {
        try {
          this.isUserDataLoading = true
  
          // const token = Vue.$cookies.get('token')
          // const decoded = jwt_decode(token)
  
          const userData = {
            // userId: decoded[enums.MlpClaimTypes.UserId],
            // userName: decoded[enums.MlpClaimTypes.UserName],
            // role: decoded[enums.MlpClaimTypes.UserRole],
            // organizationId: decoded[enums.MlpClaimTypes.OrganizationId]
          }
          commit('SET_USER_DATA', { userData })
        } catch {
          commit('SET_USER_DATA', { userData: null })
        } finally {
          this.isUserDataLoading = false
        }
      }
    },
    mutations: {
      SET_USER_DATA: (state, { userData }) => {
        state.userData = userData
      },
      SET_LOADING: (state, isLoading) => {
        state.isLoading = isLoading
      }
    },
    getters: {
      // userData: state => state.userData,
      isLoading: state => state.isLoading,
      isUserDataLoading: state => state.isUserDataLoading
    }
  })
  
  export default store
  