1 import {useEffect, useState} from "react";
2 function CreateAccount () {
3 const [email, setEmail] = useState("");
4 const [password, setPassword] = useState("");
6 const handleSubmit = async () => {
7 const response = await fetch("/api/account", {
10 "Content-Type": "application/json",
12 body: JSON.stringify({email, password}),
14 const data = await response.json();
20 <h1>Create Account</h1>,
21 <label htmlFor="email">Email
22 <form onSubmit={handleSubmit}>
23 <input type="email" value={email} onChange={(e) => setEmail(e.target.value)} />
25 <form onSubmit={handleSubmit}>
26 <input type="password" value={password} onChange={(e) => setPassword(e.target.value)} />
28 <button type="submit" >Create Account</button>
34 export default CreateAccount;