import { useState } from "react"; import type { User } from "firebase/auth"; type AuthMode = "signin" | "signup"; type AuthPanelProps = { authBusy: boolean; authEnabled: boolean; authReady: boolean; historyReady: boolean; user: User | null; onEmailAuth: ( mode: AuthMode, email: string, password: string ) => Promise; onGoogleAuth: () => Promise; onSignOut: () => Promise; }; export function AuthPanel({ authBusy, authEnabled, authReady, historyReady, user, onEmailAuth, onGoogleAuth, onSignOut, }: AuthPanelProps) { const [mode, setMode] = useState("signin"); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const submitDisabled = authBusy || !email.trim() || password.trim().length < 6 || !authReady; if (!authEnabled) { return (

Save Chat History

Firebase is not configured in the frontend yet. Add the Vite Firebase variables to enable sign in and saved conversations.

); } if (user) { return (

Account

{user.email ?? "Signed in with Google"}

This account can reopen the saved conversation on the next visit.

{historyReady ? "History sync is active." : "Loading saved conversation..."}
); } return (

Save Chat History

Guest mode still works. Sign in only if you want the chatbot to remember your conversation.

); }