import * as React from 'react';
import * as ReactDOM from 'react-dom';
import registerServiceWorker from './registerServiceWorker';
import './index.css';
import { bindActionCreators } from 'redux';
import { Provider, connect } from 'react-redux';
import { LexSetup } from './LexSetup';
import * as actionCreators from './actionCreators';
import { walleStore } from './WallEStore';

function mapStateToProps(state: any) {
  return state;
}

function mapDispachToProps(dispatch: any) {
  return bindActionCreators<any>(actionCreators, dispatch);
}

const ReduxMain = connect(mapStateToProps, mapDispachToProps)(LexSetup);

const App = (props: any) => {
  return (
    <Provider store={walleStore}>
      <ReduxMain />
    </Provider>
  );
};

ReactDOM.render(<App />, document.getElementById('root') as HTMLElement);
registerServiceWorker();

export default App;
