// NOTE: This file is stable and usually should not be modified.
// It is important that all functionality in this file is preserved, and should only be modified if explicitly requested.
import { useState } from 'react';
import { User, UserPlus } from 'lucide-react';
import { Button } from '@/components/ui/button.tsx';
import LoginDialog from './LoginDialog';
import SignupDialog from './SignupDialog';
import { useLoggedInAccounts } from '@/hooks/useLoggedInAccounts';
import { AccountSwitcher } from './AccountSwitcher';
import { cn } from '@/lib/utils';
export interface LoginAreaProps {
className?: string;
/** Compact mode for mobile headers - smaller buttons without text */
compact?: boolean;
}
export function LoginArea({ className, compact }: LoginAreaProps) {
const { currentUser } = useLoggedInAccounts();
const [loginDialogOpen, setLoginDialogOpen] = useState(false);
const [signupDialogOpen, setSignupDialogOpen] = useState(false);
const handleLogin = () => {
setLoginDialogOpen(false);
setSignupDialogOpen(false);
};
return (
{currentUser ? (
setLoginDialogOpen(true)} />
) : compact ? (
// Compact mode for mobile headers - icon only
) : (
// Default full-size buttons
)}
setLoginDialogOpen(false)}
onLogin={handleLogin}
onSignup={() => setSignupDialogOpen(true)}
/>
{/* One signup entry point. The old "Recovery Phrase vs Secret Key" method
chooser was dead code (never opened) and pure jargon for a newcomer —
SignupDialog owns the whole flow now. */}
setSignupDialogOpen(false)}
onUseAmber={() => {
setSignupDialogOpen(false);
setLoginDialogOpen(true);
}}
/>