import { useState } from 'react' import { useAuth } from '../contexts/AuthContext' export default function Login() { const { login } = useAuth() const [username, setUsername] = useState('') const [password, setPassword] = useState('') const [error, setError] = useState(null) const [loading, setLoading] = useState(false) const handleSubmit = async (e) => { e.preventDefault() setError(null) if (!username.trim() || !password) { setError('Please enter username and password.'); return } setLoading(true) try { await login(username.trim(), password) } catch (err) { setError(err.message) } finally { setLoading(false) } } return (
{/* Left panel */}
🚀

LeadGen

Market Research & Lead Generation platform. Find, import, and manage your sales pipeline.

{['Import CSV, Excel & LinkedIn', 'Web scraping & lead discovery', 'Project-based organisation', 'Export & CRM-ready data'].map(f => (
{f}
))}
{/* Right panel */}

Sign in

Welcome back — enter your credentials to continue.

{error &&
{error}
}
setUsername(e.target.value)} placeholder="Enter your username" disabled={loading} />
setPassword(e.target.value)} placeholder="Enter your password" disabled={loading} />

Forgot your password? Contact your administrator.

) }