"use client"; import { useState } from 'react'; import { Users, ShoppingCart, TrendingUp, AlertTriangle, CheckCircle, Clock, BarChart3, Activity, Calendar, Settings } from 'lucide-react'; export default function AdminDashboard() { const [selectedPeriod, setSelectedPeriod] = useState('7d'); // Sample data - in a real app, this would come from your database const stats = { totalUsers: 1247, activeUsers: 892, totalProducts: 15420, totalBuilds: 3421, revenue: 45678, growth: 12.5, pendingApprovals: 23, systemAlerts: 2 }; const recentActivity = [ { id: 1, user: 'John Doe', action: 'Created new build', time: '2 minutes ago', type: 'build' }, { id: 2, user: 'Jane Smith', action: 'Updated profile', time: '5 minutes ago', type: 'profile' }, { id: 3, user: 'Mike Johnson', action: 'Added product to cart', time: '8 minutes ago', type: 'cart' }, { id: 4, user: 'Sarah Wilson', action: 'Completed purchase', time: '12 minutes ago', type: 'purchase' }, { id: 5, user: 'Admin User', action: 'Updated category mapping', time: '15 minutes ago', type: 'admin' } ]; const topProducts = [ { name: 'AR-15 Lower Receiver', sales: 156, revenue: 12480 }, { name: 'Tactical Scope', sales: 89, revenue: 17800 }, { name: 'Gun Case', sales: 234, revenue: 11700 }, { name: 'Ammo Storage', sales: 67, revenue: 3350 }, { name: 'Cleaning Kit', sales: 189, revenue: 5670 } ]; const systemStatus = [ { service: 'Database', status: 'healthy', uptime: '99.9%' }, { service: 'API', status: 'healthy', uptime: '99.8%' }, { service: 'File Storage', status: 'warning', uptime: '98.5%' }, { service: 'Email Service', status: 'healthy', uptime: '99.7%' } ]; return (
Welcome back! Here's what's happening with your platform.
Total Users
{stats.totalUsers.toLocaleString()}
Total Products
{stats.totalProducts.toLocaleString()}
Total Builds
{stats.totalBuilds.toLocaleString()}
Revenue
${stats.revenue.toLocaleString()}
{activity.user}
{activity.action}
| Product | Sales | Revenue |
|---|---|---|
| {product.name} | {product.sales} | ${product.revenue.toLocaleString()} |