"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 { Activity, BrainCircuit, ArrowRight, Clock, Target, CheckCircle2, TrendingUp, Lock, Trophy, Share2 } 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 } = 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) } } } return (
{/* Free Tier Upgrade CTA Banner */}
Upgrade to Pro

Unlock Unlimited DPS & Mocks

You're currently on the Free Tier. Upgrade to Pro for ₹2499/yr to access unlimited Daily Practice Sheets, weekly CBT tests, and advanced analytics.

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

Performance Overview

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
)}
) }