"use client"; import { Bell, Crown, Gift, Store } from "lucide-react"; import { useSessionStore } from "@/lib/session-store"; import { useUIStore } from "@/lib/ui-store"; import { useNotifStore } from "@/lib/notification-store"; import { useI18n } from "@/lib/i18n"; import { MAX_LEVEL, xpNeededForLevel } from "@/lib/online/gamification"; import { Avatar } from "./Avatar"; import { CoinsPill } from "./CoinsPill"; export function TopBar() { const profile = useSessionStore((s) => s.profile); const go = useUIStore((s) => s.go); const openDaily = useUIStore((s) => s.openDaily); const unread = useNotifStore((s) => s.unread); const { t } = useI18n(); if (!profile) return null; const maxed = profile.level >= MAX_LEVEL; const xpNeed = xpNeededForLevel(profile.level); const xpPct = maxed ? 100 : Math.min(100, Math.max(0, Math.round((profile.xp / xpNeed) * 100))); return (