'use client'; import { useState } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { Eye, EyeOff, Mail, Lock } from 'lucide-react'; import { useAuthStore } from '@/lib/auth-store'; import toast from 'react-hot-toast'; export default function ConnexionPage() { const router = useRouter(); const { login } = useAuthStore(); const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [showPassword, setShowPassword] = useState(false); const [loading, setLoading] = useState(false); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setLoading(true); try { await login(email, password); toast.success('Connexion réussie !'); router.push('/dashboard'); } catch (error: unknown) { const axiosError = error as import('axios').AxiosError<{ message?: string }>; const message = axiosError.response?.data?.message || 'Identifiants incorrects'; toast.error(message); } finally { setLoading(false); } }; return (

CESI ZEN

Connectez-vous à votre compte

setEmail(e.target.value)} required className="w-full pl-11 pr-4 py-3 rounded-xl border border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-candlelight-500 focus:border-transparent outline-none transition-all" placeholder="vous@exemple.fr" />
setPassword(e.target.value)} required className="w-full pl-11 pr-12 py-3 rounded-xl border border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-candlelight-500 focus:border-transparent outline-none transition-all" placeholder="Votre mot de passe" />
Pas encore de compte ?{' '} Créer un compte
); }