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 (
{/* Image côté gauche */}
{/* Formulaire côté droit */}
{/* Logo */}

GTA

Gestion de congés

{/* Form */}
setEmail(e.target.value)} className="w-full pl-9 lg:pl-10 pr-4 py-2 lg:py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm lg:text-base" placeholder="votre.email@entreprise.com" required />
setPassword(e.target.value)} className="w-full pl-9 lg:pl-10 pr-10 lg:pr-12 py-2 lg:py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm lg:text-base" placeholder="••••••••" required />
{error && (

{error}

)}
); }; export default Login;