import { mapGetters } from 'vuex'
export default {
  namespaced: true,
  state: () => ({
    device: {}
  }),
  computed: {
    ...mapGetters('csServerSettings', ['getDeviceType']),
  },
  getters: {
    device: state => state.device,
    deviceType: (state, getters) => {
      return getters.getDeviceType || state.device.type
    }
  },
  actions: {
    setDevice: ({ commit }, device) => commit('SET_DEVICE', device)
  },
  mutations: {
    SET_DEVICE (state, device) {
      state.device = device
    }
  }
}
