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
+{stats.activeUsers} active this month
+{stats.scriptsThisWeek} this week
Require attention
All systems operational