import { createStore } from 'vuex'

const store = createStore({
  state: {
    isFrom: null,
    isFirstOpen: true,
  },
  mutations: {
    SET_IS_FROM(state, value) {
      state.isFrom = value
    },
    SET_IS_FIRST_OPEN(state, value) {
      state.isFirstOpen = value
    },
  },
  actions: {
    setIsFrom({ commit }, value) {
      commit('SET_IS_FROM', value)
    },
    setIsFirstOpen({ commit }, value) {
      commit('SET_IS_FIRST_OPEN', value)
    },
  },
  getters: {
    getIsFrom: (state) => state.isFrom,
    getIsFirstOpen: (state) => state.isFirstOpen,
  },
})

export default store
