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 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 */}
Sponsor Pass Tier
{employer.plan_name}
Renews: {employer.subscription_expires_at}
Manage billing & invoices
{/* Pending Offers Stat Card */}
Pending Job Offers
{stats.pending_offers}
Direct recruitment proposals
View hiring workflow
{/* Hired Count Stat Card */}
Total Hired Workers
{stats.hired_count}
Direct contracts initiated
Track active staff
{/* Shortlist Counter */}
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
{/* Dubai General Market Stats */}
Dubai General Market Insights
1,284
Hired using app in Dubai
Cooking, Care, Driving
Top Skills Hired
{/* Your own activity */}
Your Sponsor Activity Stats
{stats.shortlisted_count}
Shortlisted
{stats.hired_count}
Secure Hires
{/* Quick Actions Panel (Col 4) */}
Quick Actions
Speed up your sponsorship process.
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 */}
{/* Charity Events Module */}
Community Charity Drives
Live Events
{announcements?.map((ann) => (
))}
{/* 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.
);
}