import { Eye, EyeOff, Loader2, LogIn } from "lucide-react"; import { useState, type CSSProperties, type FormEvent } from "react"; import { LegalFootnote } from "../LegalFootnote"; import { ShellBackdrop } from "../ShellBackdrop"; import type { SetupStatus } from "../../types"; type AuthMode = "login" | "signup"; type AuthViewProps = { authError: string; busy: boolean; setupStatus: SetupStatus; shellStyle: CSSProperties; themeId: string; resolvedMode: "light" | "dark"; onLogin: (email: string, password: string) => Promise; onSignup: (name: string, email: string, password: string) => Promise; }; export function AuthView({ authError, busy, setupStatus, shellStyle, themeId, resolvedMode, onLogin, onSignup, }: AuthViewProps) { const [mode, setMode] = useState("login"); const [name, setName] = useState(""); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [showPassword, setShowPassword] = useState(false); function submit(event: FormEvent) { event.preventDefault(); if (mode === "signup") { void onSignup(name, email, password); return; } void onLogin(email, password); } return (

Red Bull tracker

Track intake, sync across devices.

{setupStatus.state !== "ok" && (
{setupStatus.message}
)}
{mode === "signup" && ( )} {authError && (
{authError}
)}
); }