import { connect } from 'react-redux';
import { StoreState } from 'store/rootReducer';
import app from 'store/app';

import Main, { StateProps, DispatchProps, OwnProps } from './Main';

const mapStateToProps = (state: StoreState): object => ({
  ready: state.app.ready,
});

const mapDispatchToProps = {
  bootup: app.actions.bootup.request.action,
};

const Wrapped = connect<StateProps, DispatchProps, OwnProps>(
  mapStateToProps,
  mapDispatchToProps,
)(Main);

export default Wrapped;
