'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 (
Enterprise ERP Platform
Enter your credentials to access the admin panel
© 2026 iFixKart. All rights reserved.