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 (
Market Research & Lead Generation platform. Find, import, and manage your sales pipeline.
Welcome back — enter your credentials to continue.
{error &&Forgot your password? Contact your administrator.