import { Activity, Bot, Boxes, Building2, Cpu, Database, Factory, Hexagon, Network, Server, SquareTerminal, Users } from "lucide-react"; import { useState } from "react"; import { useNavigate } from "react-router-dom"; import { setAuthToken, signIn } from "../lib/auth-client"; function VtitIcon() { return ( ); } export function AuthPage() { const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [name, setName] = useState(""); const [error, setError] = useState(null); const [notice, setNotice] = useState(null); const [loading, setLoading] = useState(false); const navigate = useNavigate(); async function handleSubmit(e: React.FormEvent) { e.preventDefault(); setError(null); setNotice(null); setLoading(true); const onSuccess = (ctx: any) => { const token = ctx.response.headers.get("set-auth-token"); if (token) setAuthToken(token); }; const { error } = await signIn.email({ email, password, callbackURL: "/" }, { onSuccess }); setLoading(false); if (error) { setError(error.message || "Sign in failed"); return; } navigate("/"); } return ( {/* Sci-fi Background elements */} {/* Animated glowing orbs */} {/* Floating Tech Icons - Layer 1 (Background, small) */} {/* MES */} {/* HRM */} {/* Floating Tech Icons - Layer 2 (Midground, various sizes) */} {/* Chatbot */} {/* Floating Tech Icons - Layer 3 (Foreground, highly visible) */} {/* Blockchain */} {/* ERP */} {/* Support/Chat */} {/* Grid pattern */} {/* Scanning line effect */} {/* Glassmorphism Login Modal */} {/* Logo Section */} VTIT Coding Assistant Or e.preventDefault()} className="w-full flex items-center justify-center gap-2 bg-gradient-to-r from-blue-600 to-indigo-600 border border-blue-500/50 text-white font-medium text-sm py-2.5 rounded-lg hover:from-blue-500 hover:to-indigo-500 hover:shadow-[0_0_20px_rgba(59,130,246,0.4)] transition-all uppercase tracking-wider" > Login với VTIT SSO {/* Footer Text */} Phát triển bởi P. Công Nghệ Sản Phẩm - TTCN ); } function AuthForm(props: { email: string; password: string; name: string; error: string | null; notice: string | null; loading: boolean; onEmailChange: (value: string) => void; onPasswordChange: (value: string) => void; onNameChange: (value: string) => void; onSubmit: (e: React.FormEvent) => void; }) { const inputClass = "w-full bg-[#030712]/50 border border-white/10 rounded-lg px-4 py-3 text-sm text-white placeholder-zinc-500 outline-none focus:border-accent focus:shadow-[0_0_15px_rgba(8,145,178,0.3)] transition-all"; return ( props.onEmailChange(e.target.value)} required className={inputClass} /> props.onPasswordChange(e.target.value)} required minLength={8} className={inputClass} /> {props.error && {props.error}} {props.notice && {props.notice}} {props.loading ? "Processing..." : "Đăng nhập hệ thống"} ); }
Phát triển bởi P. Công Nghệ Sản Phẩm - TTCN
{props.error}
{props.notice}