Analytics
+Track your site performance and user behavior
+{metric.value}
+{metric.title}
+diff --git a/src/pages/Analytics.tsx b/src/pages/Analytics.tsx new file mode 100644 index 0000000..65b9d89 --- /dev/null +++ b/src/pages/Analytics.tsx @@ -0,0 +1,281 @@ +import { useState } from "react"; +import { AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, PieChart, Pie, Cell } 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 { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; +import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; +import { + Eye, TrendingDown, Clock, UserPlus, ArrowUpRight, ArrowDownRight, + Globe, BarChart3 +} from "lucide-react"; +import Sidebar from "@/components/Sidebar"; +import Header from "@/components/Header"; + +const metricCards = [ + { + title: "Page Views", + value: "284,392", + change: "+14.2%", + trend: "up" as const, + icon: Eye, + color: "text-sky-600 bg-sky-100", + }, + { + title: "Bounce Rate", + value: "42.3%", + change: "-2.4%", + trend: "down" as const, + icon: TrendingDown, + color: "text-orange-600 bg-orange-100", + }, + { + title: "Session Duration", + value: "4m 32s", + change: "+18.7%", + trend: "up" as const, + icon: Clock, + color: "text-emerald-600 bg-emerald-100", + }, + { + title: "New Users", + value: "1,847", + change: "+6.3%", + trend: "up" as const, + icon: UserPlus, + color: "text-violet-600 bg-violet-100", + }, +]; + +const trafficSources = [ + { name: "Organic Search", value: 42, color: "bg-sky-500" }, + { name: "Social Media", value: 28, color: "bg-orange-500" }, + { name: "Direct", value: 18, color: "bg-emerald-500" }, + { name: "Referral", value: 12, color: "bg-violet-500" }, +]; + +const userGrowthData = [ + { month: "Jan", users: 120 }, { month: "Feb", users: 145 }, { month: "Mar", users: 162 }, + { month: "Apr", users: 158 }, { month: "May", users: 190 }, { month: "Jun", users: 210 }, + { month: "Jul", users: 235 }, { month: "Aug", users: 248 }, { month: "Sep", users: 275 }, + { month: "Oct", users: 298 }, { month: "Nov", users: 310 }, { month: "Dec", users: 342 }, +]; + +const trafficPieData = [ + { name: "Direct", value: 42 }, + { name: "Social", value: 28 }, + { name: "Organic", value: 18 }, + { name: "Referral", value: 12 }, +]; +const PIE_COLORS = ["#0ea5e9", "#f97316", "#10b981", "#8b5cf6"]; + +const topPages = [ + { url: "/", views: "45,231", bounce: "32.1%", duration: "3m 45s" }, + { url: "/products", views: "28,492", bounce: "41.8%", duration: "2m 12s" }, + { url: "/pricing", views: "19,847", bounce: "38.5%", duration: "4m 08s" }, + { url: "/blog/getting-started", views: "15,623", bounce: "25.3%", duration: "6m 32s" }, + { url: "/about", views: "12,891", bounce: "45.2%", duration: "1m 55s" }, + { url: "/contact", views: "9,472", bounce: "52.7%", duration: "1m 20s" }, + { url: "/docs/api", views: "8,234", bounce: "28.9%", duration: "5m 48s" }, + { url: "/careers", views: "6,128", bounce: "39.1%", duration: "3m 15s" }, +]; + +const geoBreakdown = [ + { country: "United States", flag: "πΊπΈ", pct: 38, visitors: "108,069" }, + { country: "United Kingdom", flag: "π¬π§", pct: 22, visitors: "62,566" }, + { country: "Germany", flag: "π©πͺ", pct: 15, visitors: "42,659" }, + { country: "Canada", flag: "π¨π¦", pct: 11, visitors: "31,283" }, +]; + +export default function AnalyticsPage() { + const [dateRange, setDateRange] = useState("30d"); + + return ( +
Track your site performance and user behavior
+{metric.value}
+{metric.title}
+