"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StatusBarReducer = exports.StatusBarReady = exports.getStatusPanelsSelector = exports.initialState = exports.StatusBarSetPanels = exports.STATUS_BAR_READY = exports.SET_STATUS_BAR_PANELS = void 0;
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
/**
 * @ReduxAction Sets Status Bar panels
 */
exports.SET_STATUS_BAR_PANELS = 'SET_STATUS_BAR_PANELS';
/**
 * @ReduxAction AdapTable Status Bar is ready
 */
exports.STATUS_BAR_READY = 'STATUS_BAR_READY';
const StatusBarSetPanels = (statusPanels) => ({
    statusPanels: statusPanels,
    type: exports.SET_STATUS_BAR_PANELS,
});
exports.StatusBarSetPanels = StatusBarSetPanels;
exports.initialState = {
    StatusBars: GeneralConstants_1.EMPTY_ARRAY,
};
const getStatusPanelsSelector = (state) => state.StatusBar.StatusBars;
exports.getStatusPanelsSelector = getStatusPanelsSelector;
const StatusBarReady = (statusBarState) => ({
    type: exports.STATUS_BAR_READY,
    statusBarState,
});
exports.StatusBarReady = StatusBarReady;
const StatusBarReducer = (state = exports.initialState, action) => {
    switch (action.type) {
        case exports.SET_STATUS_BAR_PANELS:
            const newPanels = action.statusPanels;
            return {
                ...state,
                StatusBars: newPanels,
            };
    }
    return state;
};
exports.StatusBarReducer = StatusBarReducer;
