import React, { useState, useEffect } from 'react' import { FormattedMessage, useIntl } from 'react-intl' import { useHistory } from "react-router-dom" import { Service } from '../../services/Service' import { PageContent } from '../../theme/global-style'; import Header from '../header' import Footer from '../footer' import FormErrorDialog from '../form-error-dialog' import SubmitButton from '../submit-button' type ForgotPasswordProps = { email: string; } const ForgotPassword = (props: ServiceProps) => { const [email, setEmail] = useState(""); const [errorMsg, setErrorMsg] = useState(""); const [disableButton, setDisableButton] = useState(false); const history = useHistory(); const intl = useIntl(); const handleSubmit = async (event: React.FormEvent) => { event.preventDefault(); setDisableButton(true); // Call Service ... props.service.resetPassword( email, () => history.push("/c/view/forgot-password-success"), (msg) => { setErrorMsg(msg); setDisableButton(false); } ); } return (

handleSubmit(e)}> setEmail(e.target.value)} placeholder={intl.formatMessage({ id: "forgot.email", defaultMessage: "Email" })} required={true} autoComplete="email" />
); } type ServiceProps = { service: Service } const ForgotPasswordPage = (props: ServiceProps) => { useEffect(() => { document.title = 'Reset Password | WiseMapping'; }); return (
); } export { ForgotPasswordPage }