"use client"; import { UserRound } from "lucide-react"; import { cn } from "@/lib/utils"; import { usePlayerSessionStore } from "@/stores/player-session-store"; /** * 顶栏:当前玩家称呼 + 默认币种(依赖入口或 Hydrate 拉取的 profile)。 */ export function PlayerSessionBar({ className }: { className?: string }) { const profile = usePlayerSessionStore((s) => s.profile); const label = profile?.nickname?.trim() || profile?.username?.trim() || (profile?.id != null ? `玩家 #${profile.id}` : null); return (
{label ?? "…"}
{profile?.default_currency ? ({profile.default_currency.toUpperCase()} {profile.locale ? ( {" "} · {profile.locale} ) : null}
) : null}