import React, { useState } from "react"; import { TrendingUp, Mail, Lock, ArrowRight } from "lucide-react"; import { useNavigate } from "react-router"; import { useAuthStore } from "@/stores/authStore"; const Login: React.FC = () => { const [form, setForm] = useState({ email: "", password: "" }); const [error, setError] = useState(""); const [isLoading, setIsLoading] = useState(false); const navigate = useNavigate(); const { login } = useAuthStore(); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); if (!form.email || !form.password) { return setError("All fields are required"); } setIsLoading(true); setError(""); const result = await login(form.email, form.password); if (result.success) { setIsLoading(false); navigate("/dashboard/overview"); } }; return (
{/* Left Side - Branding */}
Logo
Planpost Affiliate

Maximize Your
Earning Potential

Join thousands of affiliates earning passive income through our powerful platform.

50K+
Active Affiliates
$2.5M
Paid Out
98%
Satisfaction
{/* Right Side - Login Form */}
{/* Mobile Logo */}
AffiliatePro

Welcome back

Sign in to access your affiliate dashboard

{error && (

{error}

)}
setForm({ ...form, email: e.target.value }) } className="w-full pl-11 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition-all outline-none" />
Forgot?
setForm({ ...form, password: e.target.value }) } className="w-full pl-11 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition-all outline-none bg-white" />

Don't have an account?{" "} Sign up for free

By signing in, you agree to our{" "} Terms {" "} and{" "} Privacy Policy

); }; export default Login;