"use client"; import { useState } from "react"; import { Plus, Search, Zap, Flame, Calendar, CheckCircle2, Trophy, TrendingUp, Brain, Info, X, MoreHorizontal, ChevronRight, Activity, Clock, BarChart3, Target } from "lucide-react"; import { motion, AnimatePresence } from "framer-motion"; // Mock Data const habits = [ { id: 1, name: "Deep Work Block", frequency: "Daily", streak: 12, bestStreak: 24, progress: 85, color: "bg-[#6C5BB0]", icon: Brain, completedDays: [1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15] }, { id: 2, name: "7AM Gym Session", frequency: "Mon, Wed, Fri", streak: 4, bestStreak: 8, progress: 60, color: "bg-emerald-500", icon: Activity, completedDays: [1, 3, 5, 8, 10, 12, 15] }, { id: 3, name: "Strategic Reading", frequency: "Daily", streak: 0, bestStreak: 15, progress: 30, color: "bg-blue-500", icon: Zap, completedDays: [1, 2, 3, 4, 10, 11] }, { id: 4, name: "Journaling", frequency: "Daily", streak: 18, bestStreak: 18, progress: 100, color: "bg-orange-500", icon: Target, completedDays: Array.from({length: 15}, (_, i) => i + 1) }, ]; export default function HabitsPage() { const [selectedHabit, setSelectedHabit] = useState(null); return (
{/* Top Header */}

Mindset / Habits & Performance

18 DAY OVERALL STREAK
{/* Top Stats Overview */}
Consistency Score
92% +4% vs last week
Weekly Goals Hit
14/18 Target: 16

AI Coach

"Your 'Strategic Reading' is slipping. Consider linking it to your 'Morning Coffee' habit to increase completion by ~40%."

{/* Main Habits Container */}
{/* Habits Cards */}

Active Disciplines

{habits.map(habit => ( setSelectedHabit(habit)} className="bg-[#0A0710] border border-white/5 rounded-sm p-6 flex flex-col gap-6 relative group overflow-hidden shadow-xl cursor-pointer hover:border-primary/30 transition-all" >

{habit.name}

{habit.frequency}
{habit.streak} DAY STREAK
Completion
{habit.progress}%
{/* Mini Heatmap Visualization */}
{Array.from({length: 15}).map((_, i) => { const isCompleted = habit.completedDays.includes(i + 1); return (
); })}
))}
{/* Detailed Performance Analytics */}

Strategic Insight

Weekly Success Rate

{[45, 65, 30, 85, 95, 70, 80].map((h, i) => (
{["M", "T", "W", "T", "F", "S", "S"][i]}
))}
Momentum Building

You've maintained a 90%+ completion rate for 4 consecutive days. This is a 12% improvement over last week's performance.

Peak Performance Hub

Deep Work completion correlates 85% with 7AM Gym sessions. Physical discipline is driving your strategic output.

{/* Habit Detail Sheet */} {selectedHabit && ( <> setSelectedHabit(null)} className="fixed inset-0 bg-black/80 backdrop-blur-md z-[100]" />

{selectedHabit.name}

{selectedHabit.streak} DAY STREAK
BEST STREAK: {selectedHabit.bestStreak} DAYS

30-Day Activity Heatmap

{Array.from({length: 30}).map((_, i) => { const isCompleted = selectedHabit.completedDays.includes(i + 1); return (
); })}
FREQUENCY
{selectedHabit.frequency}
MONTHLY SUCCESS
{selectedHabit.progress}%

Performance Context

You've hit this habit {selectedHabit.completedDays.length} times this month. Strategic data suggests that completing this before 10 AM increases your daily task throughput by 12%.

)}
); }