From c85bae2c4931e037644b410fcd35a0b50f496688 Mon Sep 17 00:00:00 2001 From: Poyraz Avsever Date: Fri, 8 May 2026 12:21:12 +0300 Subject: [PATCH] feat: implement analytics dashboard page with performance metrics and Recharts visualizations --- app/(dashboard)/analytics/page.tsx | 218 +++++++++++++++++++++++++++-- 1 file changed, 209 insertions(+), 9 deletions(-) diff --git a/app/(dashboard)/analytics/page.tsx b/app/(dashboard)/analytics/page.tsx index 75fe45f..aa828ab 100644 --- a/app/(dashboard)/analytics/page.tsx +++ b/app/(dashboard)/analytics/page.tsx @@ -1,17 +1,217 @@ +"use client"; + +import { ArrowUpRight, Brain, TrendingUp, Zap, Target, ArrowDownRight, BarChart3, Filter } from "lucide-react"; +import { + Area, + AreaChart, + Bar, + BarChart, + CartesianGrid, + ResponsiveContainer, + Tooltip, + XAxis, + YAxis, + Radar, + RadarChart, + PolarGrid, + PolarAngleAxis, +} from "recharts"; + +// Mock Data +const productivityTrend = [ + { date: "May 1", focus: 65, energy: 40 }, + { date: "May 4", focus: 75, energy: 55 }, + { date: "May 8", focus: 60, energy: 50 }, + { date: "May 12", focus: 85, energy: 70 }, + { date: "May 16", focus: 72, energy: 65 }, + { date: "May 20", focus: 95, energy: 85 }, + { date: "May 24", focus: 88, energy: 80 }, +]; + +const habitCompletion = [ + { name: "Reading", completed: 85, missed: 15 }, + { name: "Workout", completed: 60, missed: 40 }, + { name: "Meditation", completed: 90, missed: 10 }, + { name: "Coding", completed: 75, missed: 25 }, +]; + +const focusRadarData = [ + { subject: "Deep Work", A: 120, fullMark: 150 }, + { subject: "Learning", A: 98, fullMark: 150 }, + { subject: "Health", A: 86, fullMark: 150 }, + { subject: "Networking", A: 65, fullMark: 150 }, + { subject: "Admin", A: 40, fullMark: 150 }, +]; + export default function AnalyticsPage() { return ( -
-
-
-

Analizler

-

- Zaman içindeki duygu durumunuzu ve görev istatistiklerinizi inceleyin. -

+
+ + {/* Top Header */} +
+

+ Analytics / Performance Metrics +

+
+
+ + +
+
-
- Gelişmiş veri analiz modülü yakında eklenecek. + + {/* KPI Row */} +
+ +
+
+ +
+

Total Focus Hours

+
+ 124.5 + + 12% + +
+
vs previous 30 days
+
+ +
+
+ +
+

Goal Completion

+
+ 82% + + 4% + +
+
vs previous 30 days
+
+ +
+
+ +
+

Productivity Score

+
+ 9.2 + + 2% + +
+
Out of 10.0 max
+
+ +
+
+ +

AI Insight

+
+

+ Your energy peaks consistently around 10:00 AM. Consider scheduling complex tasks during this block to maximize output. +

+
+
+ + {/* Charts Grid */} +
+ + {/* Main Area Chart */} +
+
+
+

Productivity vs Energy Correlation

+

How your physical energy levels impact deep work output.

+
+
+
Focus Score
+
Energy Level
+
+
+
+ + + + + + + + + + + + + + + + + + + + +
+
+ + {/* Side Charts Stack */} +
+ + {/* Radar Chart */} +
+

Effort Distribution

+
+ + + + + + + + +
+
+ + {/* Bar Chart */} +
+

Habit Consistency

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