import React from 'react'; import { motion } from 'framer-motion'; import { Users, DollarSign, Activity, ShieldAlert } from 'lucide-react'; import { useAdminDashboardView } from './useAdminDashboardView'; import { AdminDashboardHeader } from './AdminDashboardHeader'; import { AdminDashboardStatCard } from './AdminDashboardStatCard'; import { AdminDashboardTrafficCard } from './AdminDashboardTrafficCard'; import { AdminDashboardProtocolsCard } from './AdminDashboardProtocolsCard'; import { AdminDashboardNodeHealthCard } from './AdminDashboardNodeHealthCard'; import { AdminDashboardTabs } from './AdminDashboardTabs'; import { AdminDashboardSkeleton } from './AdminDashboardSkeleton'; import { ErrorDisplay } from '@/components/ui/ErrorDisplay'; export function AdminDashboardView() { const { stats, reports, uploads, auditLogs, loading, error, protocolActive, handleAction, triggerProtocol, retry, } = useAdminDashboardView(); if (loading) { return ; } if (error) { return (
); } return (
triggerProtocol('RESCAN', 'success')} onLockdown={() => triggerProtocol('LOCKDOWN', 'error')} /> {[ { label: 'Total Nodes', value: stats.totalUsers?.toLocaleString(), icon: Users, trend: stats.trends?.users, color: 'cyan' as const }, { label: 'Credit Volume', value: `$${stats.monthlyRevenue?.toLocaleString()}`, icon: DollarSign, trend: stats.trends?.revenue, color: 'gold' as const }, { label: 'Active Uplinks', value: stats.activeSessions?.toLocaleString(), icon: Activity, trend: stats.trends?.sessions, color: 'lime' as const }, { label: 'Threat Reports', value: stats.pendingReports, icon: ShieldAlert, trend: stats.trends?.reports, color: 'red' as const }, ].map((item, i) => ( } trend={item.trend} color={item.color} /> ))}
); }