"use client"; import { useState } from "react"; import { ArrowUpRight, Brain, TrendingUp, Zap, Target, ArrowDownRight, BarChart3, Filter, Download, Info, CheckCircle2, AlertCircle } from "lucide-react"; import { Area, AreaChart, Bar, BarChart, CartesianGrid, ResponsiveContainer, Tooltip, XAxis, YAxis, Radar, RadarChart, PolarGrid, PolarAngleAxis, Cell } from "recharts"; import { motion, AnimatePresence } from "framer-motion"; // 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, color: "#6C5BB0" }, { name: "Workout", completed: 60, missed: 40, color: "#a798e8" }, { name: "Meditation", completed: 90, missed: 10, color: "#10b981" }, { name: "Coding", completed: 75, missed: 25, color: "#3b82f6" }, ]; 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() { const [isExporting, setIsExporting] = useState(false); const [activeInsight, setActiveInsight] = useState(null); const handleExport = () => { setIsExporting(true); setTimeout(() => setIsExporting(false), 3000); }; return (
{/* Top Header */}

Analytics / Performance Metrics

{/* KPI Row */}
{/* Dynamic AI Score Ring */}

Strategic Readiness

94%

Optimal alignment with goals.

{/* Main Analysis Area */}
{/* Productivity Chart with Hotspots */}

Correlation: Focus vs Energy

Detailed visual mapping of biological energy impact on focus output.

Focus
Energy
{/* Chart Interaction Layer */}
{activeInsight && (
AI Observation
{activeInsight}
)}
{/* Sidebar Insights */}

Effort Distribution

Strategic Alerts

Habit Streak Maintained
Reading streak is now at 12 days. Energy levels are correlating positively.
Admin Overload
Admin tasks have increased by 15%. Consider automating these via Cognis AI.
); } function KpiCard({ title, value, change, icon: Icon, trend, color = "primary" }: any) { const isUp = trend === "up"; const trendColor = isUp ? "text-emerald-500" : "text-rose-500"; return (

{title}

{value} {isUp ? : } {change}
vs previous 30 days
); }