'use client'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Trophy, CheckCircle, RotateCcw } from 'lucide-react'; import { useCombatStore } from '@/lib/game/stores'; import { ACHIEVEMENTS } from '@/lib/game/data/achievements'; import { DebugName } from '@/components/game/debug/debug-context'; export function AchievementDebugSection() { const achievements = useCombatStore((s) => s.achievements); const unlockedCount = achievements?.unlocked?.length || 0; const totalCount = Object.keys(ACHIEVEMENTS).length; const handleUnlockAll = () => { useCombatStore.setState({ achievements: { unlocked: Object.keys(ACHIEVEMENTS), progress: Object.fromEntries( Object.keys(ACHIEVEMENTS).map((id) => [id, ACHIEVEMENTS[id].requirement.value]) ), }, }); }; const handleResetAll = () => { useCombatStore.setState({ achievements: { unlocked: [], progress: {}, }, }); }; return ( Achievement Debug
Unlocked: {unlockedCount} / {totalCount}
{Object.entries(ACHIEVEMENTS).map(([id, def]) => { const isUnlocked = achievements?.unlocked?.includes(id); return (
{def.name} ({def.category})
{isUnlocked && ( )}
); })}
); } AchievementDebugSection.displayName = "AchievementDebugSection";