From ad9e4d06f4514c5901dcff9ec4d7f32bc03fb9ad Mon Sep 17 00:00:00 2001 From: jyswee Date: Thu, 23 Jul 2026 22:10:33 +0000 Subject: [PATCH] Seed: dashboard template (24 files) --- src/pages/Index.tsx | 226 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 226 insertions(+) create mode 100644 src/pages/Index.tsx diff --git a/src/pages/Index.tsx b/src/pages/Index.tsx new file mode 100644 index 0000000..af8311c --- /dev/null +++ b/src/pages/Index.tsx @@ -0,0 +1,226 @@ +import { useState } from "react"; +import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer } from "recharts"; +import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card"; +import { Badge } from "@/components/ui/badge"; +import { Input } from "@/components/ui/input"; +import { Button } from "@/components/ui/button"; +import { Avatar, AvatarFallback } from "@/components/ui/avatar"; +import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; +import { Separator } from "@/components/ui/separator"; +import { + DollarSign, Users, ShoppingCart, TrendingUp, TrendingDown, + ArrowUpRight, ArrowDownRight, MoreHorizontal, Eye, + FileText, UserPlus, BarChart3, Download +} from "lucide-react"; +import Sidebar from "@/components/Sidebar"; +import Header from "@/components/Header"; + +const kpiCards = [ + { + title: "Total Revenue", + value: "$48.5K", + change: "+12.5%", + trend: "up" as const, + icon: DollarSign, + color: "text-sky-600 bg-sky-100", + }, + { + title: "Active Users", + value: "2,438", + change: "+8.2%", + trend: "up" as const, + icon: Users, + color: "text-orange-600 bg-orange-100", + }, + { + title: "Total Orders", + value: "1,256", + change: "+23.1%", + trend: "up" as const, + icon: ShoppingCart, + color: "text-emerald-600 bg-emerald-100", + }, + { + title: "Conversion Rate", + value: "3.2%", + change: "+0.5%", + trend: "up" as const, + icon: TrendingUp, + color: "text-violet-600 bg-violet-100", + }, +]; + +const recentOrders = [ + { id: "#ORD-7291", customer: "Sarah Mitchell", amount: "$234.50", status: "Completed", statusColor: "bg-emerald-100 text-emerald-700", date: "Apr 10, 2026" }, + { id: "#ORD-7290", customer: "James Cooper", amount: "$891.00", status: "Processing", statusColor: "bg-sky-100 text-sky-700", date: "Apr 10, 2026" }, + { id: "#ORD-7289", customer: "Emily Zhang", amount: "$156.25", status: "Completed", statusColor: "bg-emerald-100 text-emerald-700", date: "Apr 9, 2026" }, + { id: "#ORD-7288", customer: "Michael Brown", amount: "$432.80", status: "Pending", statusColor: "bg-amber-100 text-amber-700", date: "Apr 9, 2026" }, + { id: "#ORD-7287", customer: "Lisa Anderson", amount: "$67.90", status: "Cancelled", statusColor: "bg-red-100 text-red-700", date: "Apr 8, 2026" }, +]; + +const activityFeed = [ + { user: "SM", name: "Sarah Mitchell", action: "placed a new order for $234.50", time: "2 minutes ago" }, + { user: "JC", name: "James Cooper", action: "upgraded to the Pro plan", time: "15 minutes ago" }, + { user: "EZ", name: "Emily Zhang", action: "submitted a support ticket", time: "1 hour ago" }, + { user: "MB", name: "Michael Brown", action: "updated their billing information", time: "3 hours ago" }, + { user: "LA", name: "Lisa Anderson", action: "cancelled order #ORD-7287", time: "5 hours ago" }, +]; + +const revenueData = [ + { month: "Jan", revenue: 4200 }, { month: "Feb", revenue: 5400 }, { month: "Mar", revenue: 4800 }, + { month: "Apr", revenue: 6200 }, { month: "May", revenue: 5800 }, { month: "Jun", revenue: 7500 }, + { month: "Jul", revenue: 6800 }, { month: "Aug", revenue: 8200 }, { month: "Sep", revenue: 7600 }, + { month: "Oct", revenue: 9500 }, { month: "Nov", revenue: 8800 }, { month: "Dec", revenue: 10200 }, +]; + +export default function IndexPage() { + return ( +
+ +
+
+
+ {/* ── Quick Actions ── */} +
+ + + + +
+ + {/* ── KPI Cards ── */} +
+ {kpiCards.map((kpi) => ( + + +
+
+ +
+
+ {kpi.trend === "up" ? : } + {kpi.change} +
+
+
+

{kpi.value}

+

{kpi.title}

+
+
+ + + ))} +
+ + {/* ── Revenue Chart ── */} + + +
+ Revenue Overview + Monthly revenue performance for the current year +
+
+ + + +
+
+ + + + + + + + + + + + + + + + + +
+ + {/* ── Orders + Activity ── */} +
+ {/* Recent Orders */} + + +
+ Recent Orders + Latest customer orders and their status +
+ +
+ + + + + Order + Customer + Amount + Status + Date + + + + {recentOrders.map((order) => ( + + {order.id} + {order.customer} + {order.amount} + + + {order.status} + + + {order.date} + + ))} + +
+
+
+ + {/* Activity Feed */} + + + Recent Activity + Latest actions across your workspace + + + {activityFeed.map((item, i) => ( +
+ + {item.user} + +
+

+ {item.name}{" "} + {item.action} +

+

{item.time}

+
+
+ ))} +
+
+
+
+
+
+ ); +}