1function LoginForm() {
2 const [email, setEmail] = React.useState("");
3 const [password, setPassword] = React.useState("");
4
5 const handleSubmit = (e: React.FormEvent) => {
6 e.preventDefault();
7 api.login(email, password);
8 }
9 return (
10 <form onSubmit={handleSubmit}>
11 <div>
12 <label htmlFor="email">Email</label>
13 <input
14 type="email"
15 id="email"
16 value={email}
17 onChange={(e) => setEmail(e.target.value)}
18 />
19 </div>
20 <div>
21 <label htmlFor="password">Password</label>
22 <input
23 type="password"
24 id="password"
25 value={password}
26 onChange={(e) => setPassword(e.target.value)}
27 />
28 </div>
29 </form>
30 );
31}