import { agentTypes } from '../action-types/agent-action.types';
const initialState = {
  allAgents: {},
  allNewAgentsGroup: {},
  allAgentsInGroup: {},
  searchedAgent: {},
  searchedAgentGroup: {},
};
export default (state = initialState, action) => {
  switch (action.type) {
    case agentTypes.ADD_AGENT:
      return { ...state, addedAgents: action.payload };

    case agentTypes.GET_ALL_AGENTS:
      return { ...state, allAgents: action.payload };

    case agentTypes.DELETE_AN_AGENT:
      return { ...state, deletedAgent: action.payload };

    case agentTypes.ADD_NEW_AGENT_GROUP:
      return { ...state, newAgentGroup: action.payload };

    case agentTypes.GET_ALL_NEW_AGENT_GROUP:
      return { ...state, allNewAgentsGroup: action.payload };

    case agentTypes.UPDATE_AGENT_GROUP_NAME:
      return { ...state, updateAgentGroup: action.payload };

    case agentTypes.DELETE_AN_AGENT_GROUP:
      return { ...state, deletedAgentGroup: action.payload };

    case agentTypes.ADD_AGENT_TO_AN_AGENT_GROUP:
      return { ...state, addedAgentToAgentGroup: action.payload };

    case agentTypes.GET__ALL_AGENT_IN_A_GROUP:
      return { ...state, agentsInAGroup: action.payload };

    case agentTypes.DISABLE_AGENT:
      return { ...state, disabledAgents: action.payload };

    case agentTypes.REMOVE_AGENT_FROM_GROUP:
      return { ...state, removedAgentInGroup: action.payload };

    case agentTypes.GET_SEARCHED_AGENTS:
      return { ...state, searchedAgent: action.payload };

    case agentTypes.GET_SEARCHED_AGENT_GROUP:
      return { ...state, searchedAgentGroup: action.payload };

    default:
      return state;
  }
};
