import { Avatar, AvatarFallback } from "@/components/ui/avatar"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { Input } from "@/components/ui/input"; import { Progress } from "@/components/ui/progress"; import { ScrollArea } from "@/components/ui/scroll-area"; import { Separator } from "@/components/ui/separator"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@/components/ui/table"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { Activity, ArrowDownRight, ArrowUpRight, BarChart2, Bell, Calendar, ChevronRight, DollarSign, FileText, Home, LogOut, Menu, MessageSquare, MoreHorizontal, Package, Search, Settings, ShoppingCart, Star, TrendingUp, User, Users, } from "lucide-react"; import { useState } from "react"; // Navigation items data const navItems = [ { icon: Home, label: "Dashboard", active: true }, { icon: BarChart2, label: "Analytics", active: false }, { icon: ShoppingCart, label: "Orders", active: false }, { icon: Package, label: "Products", active: false }, { icon: Users, label: "Customers", active: false }, { icon: FileText, label: "Reports", active: false }, { icon: Calendar, label: "Calendar", active: false }, { icon: Settings, label: "Settings", active: false }, ]; // Stats cards data const statsCards = [ { title: "Total Revenue", value: "$45,231.89", change: "+20.1%", trend: "up", icon: DollarSign, description: "from last month", color: "text-emerald-500", bg: "bg-emerald-50", }, { title: "Active Users", value: "+2,350", change: "+15.3%", trend: "up", icon: Users, description: "from last month", color: "text-blue-500", bg: "bg-blue-50", }, { title: "New Orders", value: "+12,234", change: "+8.2%", trend: "up", icon: ShoppingCart, description: "from last month", color: "text-violet-500", bg: "bg-violet-50", }, { title: "Growth Rate", value: "+573", change: "-2.4%", trend: "down", icon: TrendingUp, description: "from last month", color: "text-orange-500", bg: "bg-orange-50", }, ]; // Recent orders data const recentOrders = [ { id: "#ORD-001", customer: "Alice Johnson", email: "alice@example.com", product: "Premium Plan", amount: "$299.00", status: "Completed", date: "Jan 15, 2024", avatar: "AJ", }, { id: "#ORD-002", customer: "Bob Smith", email: "bob@example.com", product: "Basic Plan", amount: "$99.00", status: "Pending", date: "Jan 14, 2024", avatar: "BS", }, { id: "#ORD-003", customer: "Carol White", email: "carol@example.com", product: "Enterprise Plan", amount: "$599.00", status: "Processing", date: "Jan 13, 2024", avatar: "CW", }, { id: "#ORD-004", customer: "David Brown", email: "david@example.com", product: "Premium Plan", amount: "$299.00", status: "Completed", date: "Jan 12, 2024", avatar: "DB", }, { id: "#ORD-005", customer: "Eva Martinez", email: "eva@example.com", product: "Basic Plan", amount: "$99.00", status: "Cancelled", date: "Jan 11, 2024", avatar: "EM", }, { id: "#ORD-006", customer: "Frank Lee", email: "frank@example.com", product: "Enterprise Plan", amount: "$599.00", status: "Completed", date: "Jan 10, 2024", avatar: "FL", }, ]; // Top products data const topProducts = [ { name: "Enterprise Plan", sales: 1240, revenue: "$742,560", progress: 85 }, { name: "Premium Plan", sales: 980, revenue: "$293,220", progress: 67 }, { name: "Basic Plan", sales: 760, revenue: "$75,240", progress: 52 }, { name: "Starter Pack", sales: 540, revenue: "$27,000", progress: 37 }, { name: "Add-on Bundle", sales: 320, revenue: "$16,000", progress: 22 }, ]; // Recent activity data const recentActivity = [ { user: "Alice Johnson", action: "placed a new order", time: "2 minutes ago", avatar: "AJ", type: "order", }, { user: "Bob Smith", action: "submitted a review", time: "15 minutes ago", avatar: "BS", type: "review", }, { user: "Carol White", action: "upgraded to Enterprise", time: "1 hour ago", avatar: "CW", type: "upgrade", }, { user: "David Brown", action: "cancelled subscription", time: "2 hours ago", avatar: "DB", type: "cancel", }, { user: "Eva Martinez", action: "registered as new user", time: "3 hours ago", avatar: "EM", type: "register", }, { user: "Frank Lee", action: "requested a refund", time: "5 hours ago", avatar: "FL", type: "refund", }, ]; // Notifications data const notifications = [ { title: "New order received", description: "Order #ORD-007 from Grace Kim", time: "Just now", unread: true, }, { title: "Payment confirmed", description: "Payment for #ORD-005 confirmed", time: "5 min ago", unread: true, }, { title: "Server alert", description: "CPU usage exceeded 80%", time: "1 hour ago", unread: false, }, { title: "New user registered", description: "Henry Wilson joined the platform", time: "2 hours ago", unread: false, }, ]; // Status badge color mapping const statusColors: Record = { Completed: "bg-emerald-100 text-emerald-700", Pending: "bg-yellow-100 text-yellow-700", Processing: "bg-blue-100 text-blue-700", Cancelled: "bg-red-100 text-red-700", }; export const Box = (): JSX.Element => { const [activeNav, setActiveNav] = useState("Dashboard"); const [sidebarOpen, setSidebarOpen] = useState(true); return (
{/* Sidebar */} {/* Main content */}
{/* Top header */}
{/* Search */}
{/* Notifications */} Notifications 2 new {notifications.map((notif, idx) => (
{notif.title} {notif.unread && ( )}
{notif.description} {notif.time}
))}
{/* Avatar */} JD
{/* Page content */}
{/* Page title */}

Dashboard

Welcome back, John! Here's what's happening today.

{/* Stats cards */}
{statsCards.map((stat) => (

{stat.title}

{stat.value}

{stat.trend === "up" ? ( ) : ( )} {stat.change} {stat.description}
))}
{/* Middle section: Orders table + Activity */}
{/* Recent Orders Table */}
Recent Orders Latest transactions from your store
All Completed Pending
Customer Order ID Product Amount Status Date {recentOrders.map((order) => (
{order.avatar}

{order.customer}

{order.email}

{order.id} {order.product} {order.amount} {order.status} {order.date}
))}
Customer Order ID Amount Date {recentOrders .filter((o) => o.status === "Completed") .map((order) => (
{order.avatar}

{order.customer}

{order.id} {order.amount} {order.date}
))}
Customer Order ID Amount Date {recentOrders .filter((o) => o.status === "Pending") .map((order) => (
{order.avatar}

{order.customer}

{order.id} {order.amount} {order.date}
))}
{/* Recent Activity */} Recent Activity Latest actions on your platform
{recentActivity.map((activity, idx) => (
{activity.avatar}

{activity.user} {" "} {activity.action}

{activity.time}

{idx < recentActivity.length - 1 && ( )}
))}
{/* Bottom section: Top Products + Quick Stats */}
{/* Top Products */}
Top Products Best performing products this month
View all products Export data
{topProducts.map((product, idx) => (
{idx + 1} {product.name}
{product.sales} sales {product.revenue}
))}
{/* Quick Stats */}
{/* Customer Satisfaction */} Customer Satisfaction
{[1, 2, 3, 4, 5].map((star) => ( ))}
4.8
{[ { label: "5 stars", value: 72 }, { label: "4 stars", value: 18 }, { label: "3 stars", value: 6 }, { label: "2 stars", value: 3 }, { label: "1 star", value: 1 }, ].map((rating) => (
{rating.label} {rating.value}%
))}
{/* Support Tickets */} Support Tickets
{[ { label: "Open", value: "24", color: "text-blue-600", bg: "bg-blue-50", }, { label: "Resolved", value: "142", color: "text-emerald-600", bg: "bg-emerald-50", }, { label: "Pending", value: "8", color: "text-yellow-600", bg: "bg-yellow-50", }, { label: "Closed", value: "89", color: "text-gray-600", bg: "bg-gray-100", }, ].map((ticket) => (
{ticket.value} {ticket.label}
))}
); };