import React, { useState } from "react"; import { Button, Card, Input, Space } from "antd"; import { Form, Field } from "react-final-form"; import { UserOutlined } from "@ant-design/icons"; import { resetPass } from "../API/auth/resetPass"; import Success from "./Success"; const ResetPassword: React.FC = () => { const [open, setOpen] = useState(false); const [email, setEmail] = useState(""); const validate = (val: any) => { const err: any = {}; if (!val.login) { err.login = "Required"; } return err; }; const sleep = (ms: any) => new Promise((resolve) => setTimeout(resolve, ms)); const onSubmit = async (values: any) => { setEmail(values.login); await sleep(300); await resetPass({ login: values.login }).then(() => { setOpen(true); }); }; return (