import React, { useState } from 'react'; import { useAuth } from '../contexts/AuthContext'; import ClaudeLogo from './ClaudeLogo'; const SetupForm = () => { const [username, setUsername] = useState(''); const [password, setPassword] = useState(''); const [confirmPassword, setConfirmPassword] = useState(''); const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(''); const { register } = useAuth(); const handleSubmit = async (e) => { e.preventDefault(); setError(''); if (password !== confirmPassword) { setError('Passwords do not match'); return; } if (username.length < 3) { setError('Username must be at least 3 characters long'); return; } if (password.length < 6) { setError('Password must be at least 6 characters long'); return; } setIsLoading(true); const result = await register(username, password); if (!result.success) { setError(result.error); } setIsLoading(false); }; return (
{/* Logo and Title */}

Welcome to Claude Code UI

Set up your account to get started

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

{error}

)}

This is a single-user system. Only one account can be created.

); }; export default SetupForm;