import React, { useState } from 'react'; import { useAuth } from '../contexts/AuthContext'; import { MessageSquare } from 'lucide-react'; const LoginForm = () => { 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('Please enter both username and password'); return; } setIsLoading(true); const result = await login(username, password); if (!result.success) { setError(result.error); } setIsLoading(false); }; return (
{/* Logo and Title */}

Welcome Back

Sign in to your Claude Code UI account

{/* 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="Enter your 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="Enter your password" required disabled={isLoading} />
{error && (

{error}

)}

Enter your credentials to access Claude Code UI

); }; export default LoginForm;