import { useState } from 'react'; import { motion } from 'motion/react'; import { ArrowRight, Eye, EyeOff, KeyRound } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Card, CardContent } from '@/components/ui/card'; import { Input } from '@/components/ui/input'; import { ThemeToggle } from '@/components/theme-toggle'; import { useTheme } from '@/contexts/ThemeContext'; import { cn } from '@/lib/utils'; import { APP_NAME, APP_VERSION } from '@/types'; interface LoginPageProps { onLogin: (password: string) => Promise<{ success: boolean; error?: string }>; } export function LoginPage({ onLogin }: LoginPageProps) { const { appearance } = useTheme(); const customBg = appearance.background.type !== 'none'; const [password, setPassword] = useState(''); const [showPwd, setShowPwd] = useState(false); const [error, setError] = useState(''); const [loading, setLoading] = useState(false); const [shake, setShake] = useState(0); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setError(''); setLoading(true); const result = await onLogin(password); setLoading(false); if (!result.success) { setError(result.error || '登录失败'); setShake((k) => k + 1); } }; return (
OneBot v11 协议网关 · 安全登录
© {new Date().getFullYear()} SnowLuma. All rights reserved.