"use client"; import { useState, useEffect } from "react"; import { Play, Pause, Square, Plus, Search, Clock, BarChart3, Calendar, MoreHorizontal, X, CheckCircle2, AlertCircle, Brain, Zap, TrendingUp, Activity, Briefcase, User } from "lucide-react"; import { motion, AnimatePresence } from "framer-motion"; import { ResponsiveContainer, PieChart, Pie, Cell, Tooltip, BarChart, Bar, XAxis, YAxis, CartesianGrid } from "recharts"; // Mock Data const todayTimeData = [ { name: "Deep Work", value: 240, color: "#6C5BB0" }, { name: "Meetings", value: 90, color: "#a798e8" }, { name: "Learning", value: 45, color: "#10b981" }, { name: "Admin", value: 30, color: "#3b82f6" }, ]; const weeklyTimeData = [ { day: "Mon", hours: 8.5 }, { day: "Tue", hours: 7.2 }, { day: "Wed", hours: 9.0 }, { day: "Thu", hours: 6.5 }, { day: "Fri", hours: 8.0 }, { day: "Sat", hours: 2.5 }, { day: "Sun", hours: 0 }, ]; const recentLogs = [ { id: 1, task: "Database Migration Script", project: "Infrastructure", duration: "2h 15m", date: "Today, 10:30 AM", type: "Deep Work" }, { id: 2, task: "UI Review & Polish", project: "Marketing Site", duration: "1h 45m", date: "Today, 02:00 PM", type: "Creative" }, { id: 3, task: "Client Strategy Sync", project: "Acme Corp", duration: "1h 00m", date: "Yesterday", type: "Meeting" }, { id: 4, task: "Security Audit", project: "Infrastructure", duration: "3h 30m", date: "Yesterday", type: "Deep Work" }, ]; export default function TimeTrackingPage() { const [isActive, setIsActive] = useState(false); const [seconds, setSeconds] = useState(0); useEffect(() => { let interval: any = null; if (isActive) { interval = setInterval(() => { setSeconds((seconds) => seconds + 1); }, 1000); } else if (!isActive && seconds !== 0) { clearInterval(interval); } return () => clearInterval(interval); }, [isActive, seconds]); const formatTime = (totalSeconds: number) => { const h = Math.floor(totalSeconds / 3600); const m = Math.floor((totalSeconds % 3600) / 60); const s = totalSeconds % 60; return `${h.toString().padStart(2, '0')}:${m.toString().padStart(2, '0')}:${s.toString().padStart(2, '0')}`; }; return (
{/* Top Header */}

Performance / Time Intelligence

38.5 HOURS LOGGED THIS WEEK
{/* Main Content Grid */}
{/* Left: Active Timer & Recent Logs */}
{/* Active Timer Attraction */}
Current Focus Block

{formatTime(seconds)}

Project
Marketing Site Redesign
Task
UI Audit & Review
{/* Recent Logs Table */}

Today's Activity Ledger

{recentLogs.map(log => (
{log.task}
{log.project} • {log.type}
{log.date}
{log.duration}
))}
{/* Right: Analytics & AI */}
{/* Daily Distribution Chart */}

Daily Distribution

{todayTimeData.map((entry, index) => ( ))}
{todayTimeData.map(item => (
{item.name}
{Math.floor(item.value / 60)}h {item.value % 60}m
))}
{/* AI Productivity Pulse */}

Focus Analysis

"Your deep work output is highest between 9:00 AM and 11:30 AM. Weekly burnout risk is Low (12%). Strategic momentum is positive."

{/* Weekly Summary Stat */}

Weekly Performance

Average / Day
7.4h
+12% VS LAST WEEK
); }