"use client" import { useGUCStore } from "@/lib/store" import { motion } from "framer-motion" import { ArrowLeft } from "lucide-react" import { useRouter } from "next/navigation" import { PageShell, PageHeader, Card, SectionLabel, Banner } from "@/components/ui" import { motionPresets, colors } from "@/lib/tokens" const LEVELS = [ { level: 1, emoji: "πŸ˜”", title: "Rogi", color: "#EF4444", xp: 0 }, { level: 2, emoji: "πŸ™‚", title: "Jagruk", color: "#F59E0B", xp: 150 }, { level: 3, emoji: "πŸ’ͺ", title: "Swasth", color: "#10B981", xp: 300 }, { level: 4, emoji: "βš”οΈ", title: "Yoddha", color: "#3B82F6", xp: 500 }, { level: 5, emoji: "πŸ‘‘", title: "Nirogh", color: "#A855F7", xp: 750 }, ] const XP_ACTIONS = [ { emoji: "πŸ“„", text: "Report upload karo", xp: 50 }, { emoji: "βœ…", text: "Checklist complete karo", xp: 20 }, { emoji: "πŸ’¬", text: "5 messages bhejo", xp: 5 }, { emoji: "πŸ₯—", text: "Meal log karo", xp: 15 }, { emoji: "πŸƒ", text: "Exercise karo", xp: 10 }, { emoji: "😊", text: "Mood check-in karo", xp: 5 }, { emoji: "πŸ”₯", text: "7-day streak banao", xp: 25 }, { emoji: "πŸ“€", text: "Family se share karo", xp: 30 }, ] export default function AvatarPage() { const router = useRouter() const { avatarXP: currentXP } = useGUCStore() const currentLevel = currentXP >= 750 ? 5 : currentXP >= 500 ? 4 : currentXP >= 300 ? 3 : currentXP >= 150 ? 2 : 1 const lvl = LEVELS[currentLevel - 1] const nextLvl = LEVELS[currentLevel] const progress = nextLvl ? ((currentXP - lvl.xp) / (nextLvl.xp - lvl.xp)) * 100 : 100 return ( {/* Back button */} router.back()} className="mb-5 flex items-center gap-1.5 text-sm transition-colors" style={{ color: colors.textMuted }} whileHover={{ color: colors.textPrimary }} {...motionPresets.fadeIn} > Back {/* Main level card */}
{lvl.emoji}
{lvl.title}
Level {currentLevel}
{/* XP Progress bar */}
{currentXP} XP β†’ {nextLvl?.xp ?? "MAX"} XP to Level {currentLevel + 1}
{/* Level roadmap */} πŸ—ΊοΈ Level Journey
{LEVELS.map((l, i) => { const completed = l.level < currentLevel const current = l.level === currentLevel const future = l.level > currentLevel return ( {l.emoji}
{l.title}
Level {l.level} Β· {l.xp} XP
{completed && βœ“ Done} {current && ( Current )}
) })}
{/* XP guide */} πŸ’° XP Kaise Kamayein
{XP_ACTIONS.map((a, i) => (
{a.emoji}
{a.text}
+{a.xp} XP
))}
) }