"use client" import { Card, CardContent } from "@/components/ui/card" import { Flame, Star, Clock, TrendingUp } from "lucide-react" import { useState } from "react" const SLOTS = [ { label: "6 AM", h: 30, score: 52, peak: false }, { label: "9 AM", h: 55, score: 68, peak: false }, { label: "12 PM", h: 65, score: 74, peak: false }, { label: "2 PM", h: 90, score: 91, peak: false }, { label: "3 PM", h: 100, score: 95, peak: true }, { label: "5 PM", h: 82, score: 85, peak: false }, { label: "7 PM", h: 70, score: 78, peak: false }, { label: "9 PM", h: 55, score: 67, peak: false }, { label: "11 PM", h: 32, score: 48, peak: false }, ] export function StudyTimeOptimizationCard() { const [hovered, setHovered] = useState(null) const maxH = Math.max(...SLOTS.map(s => s.h)) return (
{/* Header stats */}
Peak Window: 2 PM – 5 PM
95% efficiency at peak
{/* Bar chart with Y-axis */}
{/* Y-axis labels */}
{[100, 75, 50, 25].map(v => ( {v}% ))}
{/* Bars */}
{/* Grid lines */}
{[0, 25, 50, 75].map(pct => (
))}
{SLOTS.map((slot, i) => (
setHovered(i)} onMouseLeave={() => setHovered(null)} > {/* Tooltip */} {hovered === i && (
{slot.label}
Score: {slot.score}%
)}
))}
{/* X-axis labels */}
{SLOTS.map((slot) => (
{slot.label}
))}
{/* Efficiency breakdown */}
{[ { label: "Morning", time: "6–9 AM", eff: 60, color: "text-muted-foreground" }, { label: "Peak", time: "2–5 PM", eff: 95, color: "text-yellow-400" }, { label: "Evening", time: "7–9 PM", eff: 73, color: "text-[#00F0FF]" }, ].map(slot => (
{slot.eff}%
{slot.label}
{slot.time}
))}
You perform best 2–5 PM. Schedule your hardest mock tests and DPPs in this window.
) }