import React from 'react'; import { Head, Link } from '@inertiajs/react'; import EmployerLayout from '../../Layouts/EmployerLayout'; import { Bookmark, MessageSquare, CalendarDays, CreditCard, Search, ArrowRight, Heart, CheckCircle2, Info, Clock, ChevronRight, UserCircle2, Sparkles, Plus, Activity, TrendingUp, ShieldCheck, AlertTriangle, Star, Send, HelpCircle, UserCheck, Lock } from 'lucide-react'; export default function Dashboard({ employer, stats, shortlisted_workers, recent_messages, announcements, recommended_workers = [], saved_searches = [] }) { const [activeTab, setActiveTab] = React.useState('sponsor'); const isSubActive = employer.subscription_status === 'active'; const isExpiringSoon = stats.days_remaining <= 7; return (
{/* 1. Alerts & Warning Banners */} {!isSubActive && (

Your Sponsor Subscription Pass Has Expired!

Direct communication, candidate dossiers, and messaging are locked. Renew your annual sponsor subscription now to resume hiring.

Renew Subscription
)} {isExpiringSoon && isSubActive && (

Your Premium Sponsor Pass is expiring soon!

Only {stats.days_remaining} days left. Renew now to avoid losing contact access to 500+ verified candidates.

Renew Now
)} {/* Welcome Banner */}
Subscription Status: {employer.subscription_status} | {stats.days_remaining} Days Left

Welcome Back, {employer.name}

Hire direct, MOHRE-compliant domestic workers with zero middleman commissions. Browse our updated database of candidates with OCR passport checks.

Browse 500+ Verified Workers
{/* 2. Top-level Stats & Analytics Grid */}
{/* Subscription Pass status card */}
ACTIVE BILLING
Sponsor Pass Tier
{employer.plan_name}
Renews: {employer.subscription_expires_at}
Manage billing & invoices
{/* Pending Offers Stat Card */}
OUTSTANDING
Pending Job Offers
{stats.pending_offers}
Direct recruitment proposals
View hiring workflow
{/* Hired Count Stat Card */}
HIRED SECURELY
Total Hired Workers
{stats.hired_count}
Direct contracts initiated
Track active staff
{/* Shortlist Counter */}
SAVED LIST
Shortlisted Candidates
{stats.shortlisted_count}
Bookmark list for interviews
Open shortlist book
{/* 3. Analytics & Quick Action Section */}
{/* Worker Activity Analytics Module (Col 8) */}

Discover Insights & Market Stats

{/* Toggle Tabs */}
{activeTab === 'sponsor' ? (
{/* Dubai General Market Stats */}
Dubai General Market Insights
1,284
Hired using app in Dubai
Cooking, Care, Driving
Top Skills Hired
1.4%
Turnover rate
{/* Your own activity */}
Your Sponsor Activity Stats
14
Workers Contacted
{stats.shortlisted_count}
Shortlisted
{stats.hired_count}
Secure Hires
) : (

How Candidates Stay Motivated

Workers view real-time profile activity and interaction insights. This keeps them highly engaged and active on our platform!

Live Worker-Side Analytics Dashboard
32
Sponsors Viewed Profile
12
Sponsors Contacted You
4
Job Proposals Offered
{/* Push notification highlight */}
🔔
Instant Worker Push Alerts

When you send a message, the worker receives a push notification on their mobile app immediately, ensuring rapid responses.

)}
{/* Quick Actions Panel (Col 4) */}

Quick Actions

Speed up your sponsorship process.

Post a New Job
Receive applications directly
Find Baby Care & Nannies
Browse premium verified nannies
Direct WhatsApp Support
Chat with a recruitment manager
100% Legal UAE Agency-Free Platform
{/* 4. Detailed Workspace Rows (Col 12 Grid) */}
{/* Left Column: Recommended Workers, Shortlist, Chats */}
{/* Recommended Workers Module */}

Recommended for You

Browse all
{recommended_workers.length > 0 ? ( recommended_workers.map((worker) => (
{/* Top info */}
{worker.name.charAt(0)}
{worker.verified && ( VERIFIED )}
{worker.name}
{worker.nationality} • {worker.category}
{worker.rating} ({Math.floor(Math.random() * 15) + 3} reviews)
{/* Action buttons */}
{worker.salary} AED/mo
View Profile
)) ) : (
No workers currently recommended. Update profile details.
)}
{/* My Shortlist Module */}

Active Shortlist ({shortlisted_workers.length})

View book
{shortlisted_workers?.length > 0 ? (
{shortlisted_workers.map((worker) => (
{worker.name.charAt(0)}
{worker.name} {worker.verified && }
{worker.nationality}
Category:
{worker.category || 'General Helper'}
AVAILABILITY: {worker.availability}
Open Profile
))}
) : (
Shortlist candidates to compare their documents side-by-side
)}
{/* Recent Chats / Message Center */}

Recent Chats

All channels
{recent_messages?.length > 0 ? ( recent_messages.map((msg) => (
{msg.worker_name.charAt(0)}
{msg.worker_name}
{msg.sent_at} {msg.unread && ( )}

{msg.last_message}

)) ) : (
No recent chat logs found. Find workers to start conversing.
)}
{/* Right Column: Saved Searches, Announcements, Regulatory details */}
{/* Saved Searches Module */}

Saved Searches

{saved_searches.map((search) => ( {search.name} ))}
{/* Charity Events Module */}

Community Charity Drives

Live Events
{announcements?.map((ann) => (
❤️ Charity Drive {ann.created_at}

{ann.title}

{ann.body}

{/* Metas */}
🎁 {ann.provided_items}
📅 {ann.event_date}
{ann.location_pin && ( 📍 Open Google Maps Location Pin )}
))}
{/* Direct Sponsorship Compliance card */}

UAE Tadbeer & MOHRE Compliant

Our direct contract system aligns automatically with the Ministry of Human Resources and Emiratisation guidelines. Fully legal, zero agent fees, complete transparency.

); }