import { connect } from 'react-redux';
import { StoreState } from 'store/rootReducer';
import appActions from 'store/app/actions';
import Main, { StateProps, DispatchProps, OwnProps } from './Main';

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

const mapDispatchToProps = {
  bootup: appActions.bootup.request.action,
  sideMenuHide: appActions.sideMenu.hide.action,
};

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

export default Wrapped;
