import { Mail, User } from "lucide-react"; import { useAuthStore } from "@/stores/auth-store"; export function LoginModal() { const authStore = useAuthStore(); const handleOfflineLogin = () => { if (authStore.offlineUsername.trim()) { authStore.performOfflineLogin(); } }; const handleKeyPress = (e: React.KeyboardEvent) => { if (e.key === "Enter") { handleOfflineLogin(); } }; if (!authStore.isLoginModalOpen) return null; return (
{/* Header */}

Login

{/* Content based on mode */} {authStore.loginMode === "select" && (

Choose your preferred login method

)} {authStore.loginMode === "offline" && (
authStore.setOfflineUsername(e.target.value)} onKeyDown={handleKeyPress} className="w-full px-4 py-2.5 bg-zinc-800 border border-zinc-700 rounded-lg text-white placeholder:text-zinc-500 focus:outline-none focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 transition-colors" placeholder="Enter your Minecraft username" />
)} {authStore.loginMode === "microsoft" && (
{authStore.deviceCodeData && (
{authStore.deviceCodeData.userCode}

Your verification code

Visit{" "} {authStore.deviceCodeData.verificationUri} {" "} and enter the code above

)}

{authStore.msLoginStatus}

)}
); }