import React, { useState } from 'react'; import { useForm, Head, Link } from '@inertiajs/react'; import { Eye, EyeOff, Loader2, AlertTriangle, Info, XCircle, Users, TrendingUp, MessageSquare } from 'lucide-react'; export default function Login({ flash }) { const { data, setData, post, processing, errors, setError, clearErrors } = useForm({ email: '', password: '', remember: false, }); const [showPassword, setShowPassword] = useState(false); const validateForm = () => { let valid = true; clearErrors(); if (!data.email.trim()) { setError('email', 'Email address is required.'); valid = false; } else if (!/\S+@\S+\.\S+/.test(data.email)) { setError('email', 'Please enter a valid email address.'); valid = false; } if (!data.password) { setError('password', 'Password is required.'); valid = false; } return valid; }; const handleSubmit = (e) => { e.preventDefault(); if (!validateForm()) { return; } post('/employer/login'); }; return (
{/* Left Brand Panel (Desktop Only) */}
M
Migrant Portal
Sponsor Login

Find verified domestic workers directly.

Unlock direct access to top domestic candidates with a Migrant premium subscription. Find, interview, and hire directly without middlemen.

{/* Stat Row */}
3000+
Worker Profiles
550+
Avg Monthly Hires
Direct
Messaging
© 2026 Migrant. All rights reserved.
{/* Right Login Form */}

Welcome Back

Sign in to your sponsor portal to continue searching

{/* Status Flash Alerts */} {flash?.status === 'pending_verification' && (
Your account is pending Emirates ID verification. We'll notify you within 24 hours.
)} {flash?.status === 'rejected' && (
Verification Rejected
Reason: {flash?.reason || 'Document unreadable.'} Please re-register.
)} {flash?.status === 'subscription_expired' && (
Your subscription has expired. Renew to continue searching and shortlisting.
)}
setData('email', e.target.value)} placeholder="name@company.com" className={`w-full px-3.5 py-2.5 rounded-xl border text-sm focus:outline-none focus:ring-2 focus:ring-[#185FA5]/20 focus:border-[#185FA5] ${ errors.email ? 'border-red-500 focus:ring-red-500/20' : 'border-slate-300' }`} autoFocus /> {errors.email &&

{errors.email}

}
Forgot password?
setData('password', e.target.value)} placeholder="••••••••" className={`w-full pl-3.5 pr-10 py-2.5 rounded-xl border text-sm focus:outline-none focus:ring-2 focus:ring-[#185FA5]/20 focus:border-[#185FA5] ${ errors.password ? 'border-red-500 focus:ring-red-500/20' : 'border-slate-300' }`} />
{errors.password &&

{errors.password}

}
setData('remember', e.target.checked)} className="h-4 w-4 rounded border-slate-300 text-[#185FA5] focus:ring-[#185FA5]" />

New sponsor?{' '} Create account

); }