'use client'; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { Wrench, Eye, EyeOff, Loader2 } from 'lucide-react'; import { authService } from '@/services/api/authService'; import { toast } from 'sonner'; export default function LoginPage() { const router = useRouter(); const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [showPassword, setShowPassword] = useState(false); const [loading, setLoading] = useState(false); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); if (!email || !password) { toast.error('Enter your email and password'); return; } setLoading(true); try { await authService.login({ email, password }); toast.success('Signed in successfully'); router.push('/dashboard'); } catch (err: unknown) { const message = err instanceof Error ? err.message : 'Login failed'; toast.error(message); } finally { setLoading(false); } }; return (
{/* Logo */}

iFixKart

Enterprise ERP Platform

{/* Login Card */}

Sign In

Enter your credentials to access the admin panel

{/* Email */}
setEmail(e.target.value)} placeholder="admin@ifixkart.com" className="w-full px-3.5 py-2.5 rounded-lg border border-border bg-muted text-sm text-foreground outline-hidden transition-colors focus:ring-2 focus:ring-primary/20 focus:border-primary" autoComplete="email" />
{/* Password */}
setPassword(e.target.value)} placeholder="Enter your password" className="w-full px-3.5 py-2.5 rounded-lg border border-border bg-muted text-sm text-foreground outline-hidden transition-colors focus:ring-2 focus:ring-primary/20 focus:border-primary pr-10" autoComplete="current-password" />
{/* Submit */}

© 2026 iFixKart. All rights reserved.

); }