import {REQUEST_NEXT_ACTIONS, RECIEVE_NEXT_ACTIONS} from '../../constants/dashboardConstants';

const moduleReducers = {};

moduleReducers[REQUEST_NEXT_ACTIONS] = (state, action) => {
    return Object.assign({}, state, {
        isLoading: action.isLoading
    });
};

moduleReducers[RECIEVE_NEXT_ACTIONS] = (state, action) => {
    return Object.assign({}, state, {
        nextActions: action.nextActions,
        isLoading: action.isLoading
    });
};

const nextActionsReducer = (state = {}, action) => {

    return moduleReducers[action.type] ? moduleReducers[action.type](state, action) : state;
};

export default nextActionsReducer;
