'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getSystemInfo = exports.getConfig = undefined;

var _immutable = require('immutable');

var _immutable2 = _interopRequireDefault(_immutable);

var _cspace = require('../actions/cspace');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

exports.default = (state = _immutable2.default.Map(), action) => {
  switch (action.type) {
    case _cspace.CSPACE_CONFIGURED:
      return state.set('config', _immutable2.default.fromJS(action.payload));
    case _cspace.READ_SYSTEM_INFO_FULFILLED:
      return state.set('systemInfo', _immutable2.default.fromJS(action.payload.data));
    default:
      return state;
  }
};

const getConfig = exports.getConfig = state => state.get('config');

const getSystemInfo = exports.getSystemInfo = state => state.get('systemInfo');