import {
    combineReducers,
    createStore,
    applyMiddleware,
    compose
} from 'redux';
import thunk from "redux-thunk";
import historyTemplates from './reducers/historyTemplates';
import tabTemplate from './reducers/tabTemplate';
import patInfo from './reducers/patInfo';
import print from './reducers/print';
import preview from './reducers/preview';
import otherHistory from './reducers/otherHistory';
import diagnosticList from './reducers/diagnosticList';
import inspect from './reducers/inspect';
import assistCheck from './reducers/assistCheck';
import copyRight from './reducers/copyRight';
import homePage from './reducers/homePage';
import mainSuit from './reducers/mainSuit';
import diagnosticSearch from './reducers/diagnosticSearch'
import typeConfig from './reducers/typeConfig';
import pushMessage from './reducers/pushMessage';
import submit from './reducers/submit';
import checkBody from './reducers/checkBody';
import getInfoByUuid from './reducers/getInfoByUuid';
import treat from './reducers/treat';
import currentIll from './reducers/currentIll';
import assessResult from './reducers/assessResult';
import assessResultHis from './reducers/assessResultHis';
import medicalInfo from './reducers/medicalInfo';
import scaleSearch from './reducers/scaleSearch';
import emergencyHis from './reducers/emergencyHis';
import wrapModalBody from './reducers/wrapModalBody';
import wrapModalBodyPac from './reducers/wrapModalBodyPac';


const composeEnhancers =
    window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ?
    window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}) : compose;

const enhancer = composeEnhancers(
    applyMiddleware(thunk)
);

const rootReducer = combineReducers({
    tabTemplate,
    patInfo,
    print,
    preview,
    otherHistory,
    diagnosticList,
    historyTemplates,
    inspect,
    copyRight,
    homePage,
    mainSuit,
    diagnosticSearch,
    typeConfig,
    pushMessage,
    submit,
    treat,
    assistCheck,
    checkBody,
    getInfoByUuid,
    scaleSearch,
    currentIll,
    assessResult,
    assessResultHis,
    medicalInfo,
    emergencyHis,
    wrapModalBody,
    wrapModalBodyPac,
});

export default createStore(rootReducer, enhancer);