import DashboardLayout from '@/Layouts/DashboardLayout'; import { Head, Link } from '@inertiajs/react'; import { Card } from "@/Components/ui/card"; import { Avatar, AvatarFallback, AvatarImage } from "@/Components/ui/avatar"; import { Button } from "@/Components/ui/button"; import { BookOpen, Flame, Trophy, Play, Plus, Brain } from "lucide-react"; import { cn } from "@/lib/utils"; interface DashboardProps { stats: { xp_points: number; current_streak: number; active_courses: number; certificates: number; srs_due: number; srs_new: number; }; activeCourses: Array; user: any; } export default function Dashboard({ stats = { xp_points: 0, current_streak: 0, active_courses: 0, certificates: 0, srs_due: 0, srs_new: 0 }, activeCourses = [], user }: Partial) { // Stitch Heatmap Simulation const heatmapIntensity = ['bg-gray-200 dark:bg-white/5', 'bg-[#FF4500]/20', 'bg-[#FF4500]/40', 'bg-[#FF4500]/60', 'bg-[#FF4500]']; const heatmapCells = Array.from({ length: 84 }, () => Math.floor(Math.random() * 5)); return (
{/* SRS Review Card (Large) */}

SRS Status

{stats.srs_due} Reviews Due

{stats.srs_due > 0 ? "You have Kanji and Vocabulary items waiting. Keep your streak alive!" : "All caught up! Why not learn some new words?"}

Estimated time ~{Math.ceil(stats.srs_due * 0.5)} minutes
{/* Streak Widget */}
Daily Goal Met

{stats.current_streak} Day Streak

Don't break the chain. Keep going!

{[1, 1, 1, 1, 0, 0, 0].map((active, i) => (
))}
{/* Study Heatmap */}

Study Activity

Consistent effort yields results

Less {heatmapIntensity.map((bg, i) => (
))} More
{heatmapCells.map((level, i) => (
))}
October November December January
{/* Level Progress (Circular) */}
65% N5 Progress

JLPT N5 Path

242 / 800 Kanji mastered

{/* Quick Stats Footer */}

Items Learned

1,402

Retention Rate

88.4%

Global Rank

#412

Total XP

{stats.xp_points.toLocaleString()}

); }