import { useState } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { Loader2, ArrowRight, Command, ShieldCheck } from 'lucide-react'; import { useAuth } from '../context/AuthContext'; import { cn } from '../lib/utils'; export default function AuthOverlay() { const { isAuthenticated, login } = useAuth(); const [password, setPassword] = useState(''); const [error, setError] = useState(''); const [isSubmitting, setIsSubmitting] = useState(false); const handleLogin = async (e) => { e.preventDefault(); if (!password) return; setIsSubmitting(true); setError(''); await new Promise(resolve => setTimeout(resolve, 600)); const result = await login(password); if (!result.success) { setError(result.error); setPassword(''); } setIsSubmitting(false); }; if (isAuthenticated) return null; return (
{/* 极简网格背景 */}
{/* 顶部装饰 */}

Antigravity

请输入访问密码

{ setPassword(e.target.value); if (error) setError(''); }} placeholder="Password" className={cn( "w-full px-4 py-2.5 bg-zinc-50 border border-zinc-200 rounded-lg text-zinc-900 placeholder:text-zinc-400", "focus:outline-none focus:ring-2 focus:ring-zinc-900/5 focus:border-zinc-900 transition-all duration-200", "text-sm font-medium tracking-widest placeholder:tracking-normal", error && "border-red-500 focus:border-red-500 focus:ring-red-500/5 bg-red-50/50 text-red-900 placeholder:text-red-300" )} autoFocus /> {error && (
)}
{error && ( {error} )}
SECURE GATEWAY
); }