import { applyMiddleware, combineReducers, createStore } from "redux";
import thunk from "redux-thunk";

import { appDataReducer } from "../reducers/appDataReducer";
import { billingReducer } from "../reducers/billingReducer";
import { brandReducer } from "../reducers/brandReducer";
import { cancelReducer } from "../reducers/cancelReducer";
import { cardReducer } from "../reducers/cardReducer";
import { checkoutReducer } from "../reducers/checkoutReducer";
import { commonReducer } from "../reducers/commonReducer";
import { couponReducer } from "../reducers/couponReducer";
import { deviceReducer } from "../reducers/deviceReducer";
import { empReducer } from "../reducers/empReducer";
import { eventReducer } from "../reducers/eventReducer";
import { homeReducer } from "../reducers/homeReducer";
import { localSettingsReducer } from "../reducers/localSettingsReducer";
import { mainReducer } from "../reducers/mainReducer";
import { myPageReducer } from "../reducers/myPageReducer";
import { onSaleReducer } from "../reducers/onSaleReducer";
import { orderReducer } from "../reducers/orderReducer";
import { panelsReducer } from "../reducers/panelReducer";
import { pinCodeReducer } from "../reducers/pinCodeReducer";
import { playReducer } from "../reducers/playReducer";
import { productReducer } from "../reducers/productReducer";
import { searchReducer } from "../reducers/searchReducer";
import { shippingReducer } from "../reducers/shippingReducer";

const rootReducer = combineReducers({
  panels: panelsReducer,
  device: deviceReducer,
  common: commonReducer,
  localSettings: localSettingsReducer,
  appData: appDataReducer,
  home: homeReducer,
  brand: brandReducer,
  main: mainReducer,
  myPage: myPageReducer,
  onSale: onSaleReducer,
  product: productReducer,
  search: searchReducer,
  event: eventReducer,
  coupon: couponReducer,
  card: cardReducer,
  billing: billingReducer,
  shipping: shippingReducer,
  checkout: checkoutReducer,
  play: playReducer,
  order: orderReducer,
  cancel: cancelReducer,
  pinCode: pinCodeReducer,
  emp: empReducer,
});

export const store = createStore(rootReducer, applyMiddleware(thunk));
