import { Users, UserCheck, UserX, Activity, Smartphone, LogIn, ShieldAlert, } from 'lucide-react'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Skeleton } from '@/components/ui/skeleton'; import { useAdminDashboard, useAuditLog } from '@/hooks/useAdmin'; import { getRelativeTime } from '@/lib/date-utils'; import { cn } from '@/lib/utils'; import { StatCard, actionColor } from './shared'; export default function AdminDashboardPage() { const { data: dashboard, isLoading } = useAdminDashboard(); const { data: auditData } = useAuditLog(1, 10); const mfaPct = dashboard ? Math.round(dashboard.mfa_adoption_rate * 100) : null; const disabledUsers = dashboard ? dashboard.total_users - dashboard.active_users : null; return (
No recent logins.
) : (| Username | When |
|---|---|
| {entry.username} | {getRelativeTime(entry.last_login_at)} |
No recent actions.
) : (| Action | Actor | Target | When |
|---|---|---|---|
| {entry.action} | {entry.actor_username ?? ( system )} | {entry.target_username ?? '—'} | {getRelativeTime(entry.created_at)} |