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

import { appDataReducer } from "../reducers/appDataReducer";
import { brandReducer } from "../reducers/brandReducer";
import { commonReducer } from "../reducers/commonReducer";
import { localSettingsReducer } from "../reducers/localSettingsReducer";
import { deviceReducer } from "../reducers/deviceReducer";
import { eventReducer } from "../reducers/eventReducer";
import { homeReducer } from "../reducers/homeReducer";
import { mainReducer } from "../reducers/mainReducer";
import { myPageReducer } from "../reducers/myPageReducer";
import { onSaleReducer } from "../reducers/onSaleReducer";
import { panelsReducer } from "../reducers/panelReducer";
import { productReducer } from "../reducers/productReducer";
import { searchReducer } from "../reducers/searchReducer";

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,
});

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