import React, { useState } from 'react' import '../login.css'; function Signin({toLogin}) { const [formData, setFormData] = useState({ prenom: '', nom: '', email: '', password: '', }); const handleChange = (e) => { setFormData({...formData, [e.target.name]: e.target.value}); }; const handleSubmit = async (e) => { e.preventDefault(); try { const res = await fetch("https://axl95-medically.hf.space/api/register", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(formData) }); if (res.ok) { const data = await res.json(); console.log(data); toLogin(); } else { const errorData = await res.json().catch(() => ({})); alert(errorData.detail || "Erreur d'inscription"); } } catch (error) { console.error("Erreur lors de l'inscription", error); } }; return (

Bienvenue sur Medic.ial !

INSCRIPTION

Prénom

Nom

Adresse email

Mot de passe

(test) Déjà un compte ? Se connecter

) } export default Signin