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

import paragraph from 'store/paragraph';
import Login, { LoginProps } from './Login';

const mapStateToProps = (state: StoreState): Record<string, any> => ({
  user: state.paragraph.user,
});
const mapDispatchToProps = {
  login: paragraph.actions.login.request.action,
};

const Wrapped = connect<LoginProps>(mapStateToProps, mapDispatchToProps)(Login);

export default Wrapped;
