import React from 'react'; import { Head, Link, router } from '@inertiajs/react'; import AdminLayout from '@/Layouts/AdminLayout'; import { Users, ShieldAlert, CreditCard, BadgeDollarSign, CheckCircle, ArrowRight } from 'lucide-react'; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from '@/components/ui/table'; export default function Dashboard({ stats, recent_verifications, recent_subscriptions }) { const handleApprove = (id) => { router.post('/admin/verifications/approve', { id }); }; const handleReject = (id) => { router.post('/admin/verifications/reject', { id }); }; return ( {/* Stat Cards Row */}
{/* Total Workers */}
Total Workers

{stats?.total_workers?.toLocaleString() || 0}

+12% from last month

{/* Verified Today */}
Auto-Verified Today

12

Automatic
{/* Active Subscriptions */}
Active Subscriptions

{stats?.active_subscriptions?.toLocaleString() || 0}

+{stats?.new_employers_this_week || 0} new this week

{/* Monthly Revenue */}
Revenue This Month

AED {stats?.revenue_this_month_aed?.toLocaleString() || 0}

Updated real-time

{/* Recent Verifications Section */}

Recent Verifications

Profiles automatically verified via document proof

View audit logs
{recent_verifications && recent_verifications.length > 0 ? ( Name Type Document Processed Status {recent_verifications.map((item) => ( {item.name} {item.type} {item.document_type} {item.processed_at} {item.status || 'Verified'} ))}
) : (

No recent activity

Automatic verification system is monitoring new registrations.

)}
{/* Recent Subscriptions Section */}

Recent Subscriptions

Latest employer subscription activations and renewals

View all
{recent_subscriptions && recent_subscriptions.length > 0 ? ( Employer Plan Amount Date {recent_subscriptions.map((item) => ( {item.employer_name} {item.plan_name} AED {item.amount_aed} {item.subscribed_at} ))}
) : (
No recent subscriptions found.
)}
); }