import React, { useState } from 'react'; import { useAuth } from '../contexts/AuthContext'; import { MessageSquare } from 'lucide-react'; import { useTranslation } from 'react-i18next'; const LoginForm = () => { const { t } = useTranslation('auth'); const [username, setUsername] = useState(''); const [password, setPassword] = useState(''); const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(''); const { login } = useAuth(); const handleSubmit = async (e) => { e.preventDefault(); setError(''); if (!username || !password) { setError(t('errors.requiredFields')); return; } setIsLoading(true); const result = await login(username, password); if (!result.success) { setError(result.error); } setIsLoading(false); }; return (
{/* Logo and Title */}

{t('login.title')}

{t('login.description')}

{/* Login Form */}
setUsername(e.target.value)} className="w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent" placeholder={t('login.placeholders.username')} required disabled={isLoading} />
setPassword(e.target.value)} className="w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent" placeholder={t('login.placeholders.password')} required disabled={isLoading} />
{error && (

{error}

)}

Enter your credentials to access Claude Code UI

); }; export default LoginForm;