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

const initialState = {
  bestSellerData: {},
};

export const productReducer = (state = initialState, action) => {
  switch (action.type) {
    case types.GET_BEST_SELLER:
      return {
        ...state,
        bestSellerData: action.payload,
      };
    case types.GET_PRODUCT_OPTION:
      return {
        ...state,
        prdtOptInfo: action.payload.prdtOptInfo,
      };
    case types.GET_PRODUCT_GROUP:
      return {
        ...state,
        groupInfo: action.payload.groupInfo,
      };
    default:
      return state;
  }
};
