"use client"; import React from "react"; import { useRouter } from "next/navigation"; import { motion, AnimatePresence } from "framer-motion"; import useUserStore from "@/stores/useUserStore"; interface ProfileModalProps { onClose: () => void; } export default function ProfileModal({ onClose }: ProfileModalProps) { const router = useRouter(); const { name, title, level, xp, longestStreak, coursesCompleted, preferences, setPreferences, logout, } = useUserStore(); const { soundOn, darkGlass, difficulty } = preferences; return ( {/* Backdrop */} {/* Modal card */} {/* Floating avatar – overlaps top edge */}
{/* Edit badge */}
{/* Glass card body */}
{/* Name & title */}

Level {level} {title}

{name}

{/* ── Stats Grid ── */}

Stats Grid

{/* ── Preferences ── */}

Preferences

{/* Sound Effects */}
Sound Effects setPreferences({ soundOn: !soundOn })} />
{/* Dark/Light Theme */}
Dark/Light Theme
Dark/Glass setPreferences({ darkGlass: !darkGlass })} />
{/* Difficulty Scaling */}
Difficulty Scaling setPreferences({ difficulty: Number(e.target.value) })} className="w-full h-1.5 rounded-full appearance-none cursor-pointer accent-brand-teal bg-brand-gray-200" />
{/* ── Log Out ── */}
); } /* ── Stat box ── */ function StatBox({ label, value }: { label: string; value: string }) { return (

{label}

{value}

); } /* ── Toggle switch ── */ function Toggle({ on, onChange }: { on: boolean; onChange: () => void }) { return ( ); } /* ── Owl avatar (large) ── */ function OwlAvatar() { return ( {/* Body */} {/* Eyes bg */} {/* Eye rims (glasses) */} {/* Pupils */} {/* Highlights */} {/* Beak */} {/* Ear tufts */} {/* Feet */} ); }