import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; import { Button } from '@/components/ui/button'; import { Badge } from '@/components/ui/badge'; import { Users, FileText, MessageSquare, TrendingUp, AlertTriangle, CheckCircle, Clock, BarChart3 } from 'lucide-react'; interface AdminDashboardProps { onCreateUser: () => void; onViewScripts: () => void; onViewAnalytics: () => void; } export function AdminDashboard({ onCreateUser, onViewScripts, onViewAnalytics }: AdminDashboardProps) { // Mock data - in a real app, this would come from API calls const stats = { totalUsers: 1247, totalScripts: 89, pendingApprovals: 12, totalComments: 456, activeUsers: 234, scriptsThisWeek: 8, commentsThisWeek: 23, systemHealth: 'healthy' }; const recentActivity = [ { id: 1, type: 'script', action: 'submitted', title: 'Docker Setup Script', user: 'john_doe', time: '2 hours ago' }, { id: 2, type: 'comment', action: 'reported', title: 'Comment on Backup Script', user: 'jane_smith', time: '4 hours ago' }, { id: 3, type: 'user', action: 'registered', title: 'New user account', user: 'alex_wilson', time: '6 hours ago' }, { id: 4, type: 'script', action: 'approved', title: 'Network Monitor', user: 'admin', time: '1 day ago' }, ]; const getActivityIcon = (type: string) => { switch (type) { case 'script': return ; case 'comment': return ; case 'user': return ; default: return ; } }; const getActivityColor = (type: string) => { switch (type) { case 'script': return 'text-blue-600'; case 'comment': return 'text-green-600'; case 'user': return 'text-purple-600'; default: return 'text-gray-600'; } }; return (
{/* Quick Stats */}
Total Users
{stats.totalUsers.toLocaleString()}

+{stats.activeUsers} active this month

Total Scripts
{stats.totalScripts}

+{stats.scriptsThisWeek} this week

Pending Approvals
{stats.pendingApprovals}

Require attention

System Health
{stats.systemHealth}

All systems operational

{/* Quick Actions */} Quick Actions Common administrative tasks and shortcuts.
{/* Recent Activity */} Recent Activity Latest platform activities requiring attention.
{recentActivity.map((activity) => (
{getActivityIcon(activity.type)}
{activity.title} {activity.action}
by @{activity.user} • {activity.time}
))}
{/* System Status */} System Status Current platform status and alerts.
Database
Operational
File Storage
Operational
Email Service
Operational
); }