import React from 'react';
import ReactDom from 'react-dom';
import {createStore , applyMiddleware} from 'redux';
import {Provider} from 'react-redux';
import reducers from './reducers/index';
import { createLogger } from 'redux-logger'
import thunkMiddleware from 'redux-thunk';
require('./index.css');
import PageContainer from './containers/PageContainer/PageContainer';
const env = process.env.NODE_ENV;

function activateVendor() {
    const logMiddleware = createLogger();
    return (
        env === "development" ? createStore(
            reducers,
            applyMiddleware(
                thunkMiddleware,
                logMiddleware
            )
        ) : createStore(
            reducers,
            applyMiddleware(
                thunkMiddleware,
            )
        )
    )
}
function renderPage(store) {
    ReactDom.render(
        <Provider store={store}>
            <PageContainer />
        </Provider>,
        document.getElementById('root')
    )
}

let store = activateVendor();
UTILPATH.socket.getIp1();
UTILPATH.socket.stopServer();
// UTILPATH.socket.getTestIp(203);

renderPage(store);