import { useState } from 'react'; import { Link, useNavigate } from 'react-router-dom'; import { LogIn } from 'lucide-react'; import { useAuth } from '../../context/auth-context.jsx'; import { useUi } from '../../context/ui-context.jsx'; import { useBranding } from '../../context/branding-context.jsx'; import { Field } from '../../components/Field.jsx'; import { Button } from '../../components/Button.jsx'; import { PasswordInput } from '../../components/PasswordInput.jsx'; import logoDark from '../../assets/logoLinkedCorpTxt.png'; import logoLight from '../../assets/logoLinkedCorpTxtBlack.png'; export default function LoginPage() { const { login } = useAuth(); const { t, theme } = useUi(); const branding = useBranding(); const navigate = useNavigate(); const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [error, setError] = useState(''); const [loading, setLoading] = useState(false); async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); try { await login(email, password); navigate('/', { replace: true }); } catch (err) { setError(err.message || t('login_error')); } finally { setLoading(false); } } return (