import { settingsTypes } from '../action-types/settings.types';

const initialState = {
  countries: {},
};

export default (state = initialState, action) => {
  switch (action.type) {
    case settingsTypes.RESET_PASSWORD:
      return action.payload;

    case settingsTypes.UPDATE_PROFILE:
      return {
        ...state,
        updateProfile: action.payload,
      };

    case settingsTypes.GET_PROFILE:
      return {
        ...state,
        profile: action.payload,
      };
    case settingsTypes.GET_COUNTRIES:
      return {
        ...state,
        countries: action.payload,
      };

    default:
      return state;
  }
};
