import React, { useState } from 'react'; import { Link, useNavigate } from 'react-router-dom'; export default function LoginPage({ onLogin }) { const navigate = useNavigate(); const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [error, setError] = useState(''); const [loading, setLoading] = useState(false); const handleSubmit = async (e) => { e.preventDefault(); setError(''); setLoading(true); try { // Mock login - replace with Supabase auth if (email && password) { // Simulate API call await new Promise(resolve => setTimeout(resolve, 1000)); // For demo, accept any valid-looking email if (email.includes('@') && password.length >= 6) { onLogin?.({ email }); navigate('/app'); } else { setError('Invalid email or password'); } } } catch (err) { setError('An error occurred. Please try again.'); } finally { setLoading(false); } }; return (
AeThex Connect

Welcome back!

We're so excited to see you again!

{error && (
⚠️ {error}
)}
setEmail(e.target.value)} required autoComplete="email" disabled={loading} />
setPassword(e.target.value)} required autoComplete="current-password" disabled={loading} /> Forgot your password?

Need an account? Register

← Back to home
); }