import { connect, Dispatch } from 'react-redux';
import {
  Signin,
  Props as SigninProps,
  State as SigninState,
} from '../components/Signin';
import State from 'member/signin/redux/state';

import signinActions from 'member/signin/redux/action';


export function mapStateToProps(state: any): SigninProps {
  return {
    isSignin: state.member.signin.isAuthenticated,
  };
}

export function mapDispatchToProps(dispatch: Dispatch<any>): SigninProps {
  return {
    onSignin: (signinId: string, signinPw: string) => {
      dispatch(signinActions.request(signinId, signinPw));
    },
    onSignup: () => {
      return;
    },
    onResetPassword: () => {
      return;
    },
  };
}

export default connect(mapStateToProps, mapDispatchToProps)(Signin);
