import { useState } from 'react' import { useAuth } from '../context/AuthContext' import { ForgotPassword } from './PasswordRecovery' export default function LoginScreen() { const { login } = useAuth() const [showForgot, setShowForgot] = useState(false) const [email, setEmail] = useState('') const [password, setPassword] = useState('') const [error, setError] = useState(null) const [loading, setLoading] = useState(false) if (showForgot) return (
Mitai Jinkendo
setShowForgot(false)}/>
) const handleLogin = async () => { if (!email.trim() || !password.trim()) { setError('E-Mail und Passwort eingeben'); return } setLoading(true); setError(null) try { await login({ email: email.trim().toLowerCase(), password: password }) } catch(e) { setError(e.message || 'Ungültige E-Mail oder Passwort') } finally { setLoading(false) } } return (
{/* Logo */}
Mitai Jinkendo
身体 · KÖRPER · GESUNDHEIT · VITALITÄT
{/* Login Card */}
Anmelden
setEmail(e.target.value)} onKeyDown={e=>e.key==='Enter'&&document.getElementById('pw-input')?.focus()} style={{width:'100%',boxSizing:'border-box'}} autoFocus autoComplete="email"/>
setPassword(e.target.value)} onKeyDown={e=>e.key==='Enter'&&handleLogin()} style={{width:'100%',boxSizing:'border-box'}} autoComplete="current-password"/>
{error && (
{error}
)}
人拳道 · Der menschliche Weg der Kampfkunst
) }