import { types } from "../actions/actionTypes";

const initialState = {
  termsData: {},
  menuData: {},
  layoutData: {},
  mainContentsData: {},
  themeCurationInfoData: {},
};

export const homeReducer = (state = initialState, action) => {
  switch (action.type) {
    case types.GET_HOME_TERMS:
      return {
        ...state,
        termsData: action.payload,
      };

    case types.GET_HOME_MENU:
      return {
        ...state,
        menuData: action.payload,
      };

    case types.GET_HOME_LAYOUT:
      return {
        ...state,
        layoutData: action.payload,
      };

    case types.GET_HOME_MAIN_CONTENTS:
      return {
        ...state,
        mainContentsData: action.payload,
      };

    case types.GET_THEME_CURATION_INFO:
      return {
        ...state,
        themeCurationInfoData: action.payload,
      };

    default:
      return state;
  }
};
