import React, { useState } from 'react'; import { useAuth } from '../context/AuthContext'; import { useNavigate } from 'react-router-dom'; import { Building2, Mail, Lock, Eye, EyeOff } from 'lucide-react'; const Login = () => { const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [showPassword, setShowPassword] = useState(false); const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(''); const navigate = useNavigate(); const { login, loginWithO365 } = useAuth(); const handleSubmit = async (e) => { e.preventDefault(); setIsLoading(true); setError(''); const success = await login(email, password); if (success) { navigate('/dashboard'); } else { setError('Identifiants incorrects. Veuillez réessayer.'); } setIsLoading(false); }; return (
Gestion de congés