diff --git a/src/pages/Dashboard.tsx b/src/pages/Dashboard.tsx new file mode 100644 index 0000000..e2ff379 --- /dev/null +++ b/src/pages/Dashboard.tsx @@ -0,0 +1,172 @@ +import Sidebar from "@/components/Sidebar"; +import DashboardHeader from "@/components/DashboardHeader"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { Button } from "@/components/ui/button"; +import { Badge } from "@/components/ui/badge"; +import { Avatar, AvatarFallback } from "@/components/ui/avatar"; +import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; +import { DollarSign, Users, TrendingDown, ThumbsUp, ArrowUpRight, ArrowDownRight, Plus, UserPlus, Download } from "lucide-react"; +import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer } from "recharts"; + +const kpis = [ + { label: "MRR", value: "\$48,250", trend: "+12.5%", up: true, icon: DollarSign, color: "bg-sky-100 text-sky-600" }, + { label: "Active Users", value: "2,847", trend: "+8.2%", up: true, icon: Users, color: "bg-emerald-100 text-emerald-600" }, + { label: "Churn Rate", value: "2.4%", trend: "-0.3%", up: false, icon: TrendingDown, color: "bg-orange-100 text-orange-600" }, + { label: "NPS", value: "72", trend: "+4", up: true, icon: ThumbsUp, color: "bg-violet-100 text-violet-600" }, +]; + +const revenueData = [ + { month: "Jan", revenue: 32000 }, { month: "Feb", revenue: 34500 }, + { month: "Mar", revenue: 36200 }, { month: "Apr", revenue: 38100 }, + { month: "May", revenue: 37800 }, { month: "Jun", revenue: 39500 }, + { month: "Jul", revenue: 41200 }, { month: "Aug", revenue: 43000 }, + { month: "Sep", revenue: 44800 }, { month: "Oct", revenue: 45200 }, + { month: "Nov", revenue: 46900 }, { month: "Dec", revenue: 48250 }, +]; + +const activities = [ + { name: "Sarah Chen", action: "Upgraded to Pro", date: "2 hours ago", status: "completed", initials: "SC" }, + { name: "Marcus Johnson", action: "Created new project", date: "4 hours ago", status: "completed", initials: "MJ" }, + { name: "Emily Rivera", action: "Submitted support ticket", date: "5 hours ago", status: "pending", initials: "ER" }, + { name: "David Kim", action: "Payment processed", date: "6 hours ago", status: "completed", initials: "DK" }, + { name: "Anna Petrov", action: "Account deactivated", date: "8 hours ago", status: "failed", initials: "AP" }, + { name: "James Wright", action: "Invited team member", date: "10 hours ago", status: "completed", initials: "JW" }, + { name: "Lisa Nguyen", action: "Exported data", date: "12 hours ago", status: "completed", initials: "LN" }, + { name: "Tom Bradley", action: "Updated billing info", date: "1 day ago", status: "pending", initials: "TB" }, +]; + +export default function DashboardPage() { + return ( +
+ +
+ +
+ {/* KPI Cards */} +
+ {kpis.map((kpi) => { + const Icon = kpi.icon; + return ( + + +
+
+

{kpi.label}

+

{kpi.value}

+
+
+ +
+
+
+ {kpi.up ? : } + {kpi.trend} + vs last month +
+
+
+ ); + })} +
+ + {/* Revenue Chart */} + + + Revenue Overview + + +
+ + + + + + + + + +
+
+
+ + {/* Recent Activity */} + + + Recent Activity + + + + + + User + Action + Date + Status + + + + {activities.map((a, i) => ( + + +
+ + {a.initials} + + {a.name} +
+
+ {a.action} + {a.date} + + + {a.status} + + +
+ ))} +
+
+
+
+ + {/* Quick Actions */} +
+ + +
+ +
+
+

New Project

+

Create a new project

+
+
+
+ + +
+ +
+
+

Invite Team

+

Add team members

+
+
+
+ + +
+ +
+
+

Export Report

+

Download analytics

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