'use client'; import { Sparkles, Swords, BookOpen, Target, FlaskConical, Cog, Hammer } from 'lucide-react'; import type { GameAction } from '@/lib/game/types'; interface ActionButtonsProps { currentAction: GameAction; currentStudyTarget: { type: 'skill' | 'spell'; id: string; progress: number; required: number } | null; designProgress: { progress: number; required: number } | null; designProgress2: { progress: number; required: number } | null; preparationProgress: { progress: number; required: number } | null; applicationProgress: { progress: number; required: number } | null; equipmentCraftingProgress: { progress: number; required: number } | null; } // Map action IDs to labels and icons const ACTION_CONFIG: Record = { meditate: { label: 'Meditating', icon: Sparkles, color: 'text-blue-400' }, climb: { label: 'Climbing', icon: Swords, color: 'text-green-400' }, study: { label: 'Studying', icon: BookOpen, color: 'text-yellow-400' }, design: { label: 'Designing Enchantment', icon: Target, color: 'text-purple-400' }, prepare: { label: 'Preparing Equipment', icon: FlaskConical, color: 'text-purple-400' }, enchant: { label: 'Enchanting', icon: Sparkles, color: 'text-purple-400' }, craft: { label: 'Crafting Equipment', icon: Hammer, color: 'text-orange-400' }, convert: { label: 'Converting Mana', icon: Cog, color: 'text-cyan-400' }, }; function ProgressBar({ progress, required, label }: { progress: number; required: number; label?: string }) { const percentage = Math.min(100, (progress / required) * 100); return (
{label &&
{label}
}
); } export function ActionButtons({ currentAction, currentStudyTarget, designProgress, designProgress2, preparationProgress, applicationProgress, equipmentCraftingProgress, }: ActionButtonsProps) { const config = ACTION_CONFIG[currentAction] || { label: currentAction, icon: Sparkles, color: 'text-gray-400' }; const Icon = config.icon; // Calculate additional info for specific actions const getActionDetails = () => { switch (currentAction) { case 'study': if (currentStudyTarget) { const progress = currentStudyTarget.progress; const required = currentStudyTarget.required; const percentage = Math.min(100, (progress / required) * 100); return ( ); } break; case 'design': if (designProgress) { return ( ); } break; case 'prepare': if (preparationProgress) { return ( ); } break; case 'enchant': if (applicationProgress) { return ( ); } break; case 'craft': if (equipmentCraftingProgress) { return ( ); } break; } return null; }; return (
Current Activity
{config.label}
{getActionDetails()} {/* Show second design slot if active */} {designProgress2 && (
Second Design Slot
)}
); } ActionButtons.displayName = "ActionButtons"; ProgressBar.displayName = "ProgressBar";