// @flow import { SITE_NAME } from 'config'; import React, { useState } from 'react'; import { FormField, Form } from 'component/common/form'; import Button from 'component/button'; import Card from 'component/common/card'; import Nag from 'component/common/nag'; import UserPasswordReset from 'component/userPasswordReset'; type Props = { errorMessage: ?string, emailToVerify: ?string, doClearEmailEntry: () => void, doUserSignIn: (string, ?string) => void, onHandleEmailOnly: () => void, isPending: boolean, }; export default function UserSignInPassword(props: Props) { const { errorMessage, doUserSignIn, emailToVerify, onHandleEmailOnly, isPending } = props; const [password, setPassword] = useState(''); const [forgotPassword, setForgotPassword] = React.useState(false); function handleSubmit() { if (emailToVerify) { doUserSignIn(emailToVerify, password); } } function handleChangeToSignIn() { onHandleEmailOnly(); } return (