import { useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { useAuthStore } from '@/stores/auth'; export function LoginPage() { const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [error, setError] = useState(''); const [isLoading, setIsLoading] = useState(false); const navigate = useNavigate(); const { login } = useAuthStore(); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setError(''); setIsLoading(true); try { await login(email, password); navigate('/inbox'); } catch (err) { setError(err instanceof Error ? err.message : 'Login failed'); } finally { setIsLoading(false); } }; return (
{/* Logo/Header */}

Todo App

Sign in to your account

{/* Login form */}
{error && (
{error}
)}
setEmail(e.target.value)} required autoComplete="email" className="input" placeholder="you@example.com" />
setPassword(e.target.value)} required autoComplete="current-password" className="input" placeholder="••••••••" />
{/* Footer note */}

This app is invite-only. Contact an admin for access.

); }