'use client'; import { DebugName } from '@/components/game/debug/debug-context'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Sparkles, Unlock } from 'lucide-react'; import { ATTUNEMENTS_DEF } from '@/lib/game/data/attunements'; import { useAttunementStore } from '@/lib/game/stores'; import { useManaStore } from '@/lib/game/stores'; export function AttunementDebug() { const attunements = useAttunementStore((s) => s.attunements); const debugUnlockAttunement = useAttunementStore((s) => s.debugUnlockAttunement); const addAttunementXP = useAttunementStore((s) => s.addAttunementXP); const handleUnlockAttunement = (id: string) => { if (debugUnlockAttunement) { debugUnlockAttunement(id); // When unlocking an attunement that has a primary mana type, unlock that element const attunementDef = ATTUNEMENTS_DEF[id]; if (attunementDef?.primaryManaType) { useManaStore.getState().unlockElement(attunementDef.primaryManaType, 0); } } }; const handleAddAttunementXP = (id: string, amount: number) => { if (addAttunementXP) { addAttunementXP(id, amount); } }; return ( Attunements {Object.entries(ATTUNEMENTS_DEF || {}).map(([id, def]) => { const isActive = attunements?.[id]?.active; const level = attunements?.[id]?.level || 1; const xp = attunements?.[id]?.experience || 0; return (
{def.icon}
{def.name}
{isActive && (
Lv.{level} • {xp} XP
)}
); })}
); } AttunementDebug.displayName = "AttunementDebug";