/* eslint-disable no-undef */
'use strict';

import 'babel-polyfill';
import React from 'react';
import { render } from 'react-dom';
import { createStore, applyMiddleware } from 'redux';
import { Provider } from 'react-redux';
import thunkMiddleware from 'redux-thunk';
import { composeWithDevTools } from 'redux-devtools-extension';
import appReducer from './models';
import '../styles/main.scss';
import App from './App';
import ErrorBoundary from 'components/ErrorBoundary';

const middlewareEnhancer = applyMiddleware(thunkMiddleware);

const store = createStore(appReducer, process.env.NODE_ENV == 'development' ? composeWithDevTools(middlewareEnhancer) : middlewareEnhancer);

render(
  <Provider store={store}>
    <ErrorBoundary>
      <App />
    </ErrorBoundary>
  </Provider>,
  document.getElementById('easyv-app')
);
