"use client" import { useRef } from "react" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { BrainCircuit, Play, ChevronRight, Activity, Target, CheckCircle2, AlertTriangle, TrendingUp, Calendar, Zap, LayoutDashboard, Share2, Trophy, Lock, ArrowRight, Clock } from "lucide-react" import * as htmlToImage from 'html-to-image' import { MistakeHeatmap } from "@/components/AI/MistakeHeatmap" import { AdaptiveStudyPlan } from "@/components/AI/AdaptiveStudyPlan" import { useActiveUser } from "@/hooks/useActiveUser" export default function DashboardPage() { const { user, hasAccessTo, loading } = useActiveUser() const progressRef = useRef(null) const handleExport = async () => { if (progressRef.current) { try { const dataUrl = await htmlToImage.toPng(progressRef.current, { backgroundColor: '#09090b' }) const link = document.createElement('a') link.download = 'pragativeer-progress.png' link.href = dataUrl link.click() } catch (err) { console.error("Failed to export image", err) } } } if (loading) { return (

Loading dashboard...

) } return (
{/* Basic Performance Dashboard (F-05) */}

Performance Overview

Your overall progress, scores, and active study plan at a glance.

Today's Score

42 / 60

+5 from yesterday

Overall Accuracy

68%

Needs Improvement

Qs Attempted

1,245

Lifetime total

City Rank

#42 / 1,200

Top 5% in Jaipur

{/* Dynamic DPP Modules */}

Today's DPPs

Physics: Rotational Dynamics

20 Questions • High Priority

{hasAccessTo("topic-wise-microtests-unlimited") ? (

Biology: Human Physiology

30 Questions • Medium Priority

) : (

Biology: Human Physiology

Pro Feature

)}
{/* Upcoming CBTs */}

Upcoming CBTs

Mock Test Tomorrow, 10:00 AM

AITS Full Syllabus Test 4

180 Minutes • 720 Marks

{hasAccessTo("weekly-test-series") ? (

Part Test 3: Mechanics

Oct 24, 2026

) : (

Part Test 3: Mechanics

Oct 24, 2026

Pro Only
)}
) }