import { LockKeyhole } from "lucide-react";
import { useState, type FormEvent } from "react";
import { Navigate } from "react-router";
import { useAuth } from "../auth/AuthContext";
import { useDeploymentProfile } from "../deployment/DeploymentProfileContext";
import { ApiError } from "../lib/api";
import { Button, ErrorBanner, Field, Input } from "../components/Ui";
import { AdminCopyright } from "../components/AdminCopyright";
export function LoginPage() {
const { user, login } = useAuth();
const { profile, assetUrl } = useDeploymentProfile();
const [userName, setUserName] = useState("");
const [password, setPassword] = useState("");
const [busy, setBusy] = useState(false);
const [error, setError] = useState("");
if (user) return