'use client'; import { Button } from '@/components/ui/button'; import { Progress } from '@/components/ui/progress'; import { BookOpen, X } from 'lucide-react'; import { SKILLS_DEF, SPELLS_DEF } from '@/lib/game/constants'; import { formatStudyTime } from '@/lib/game/formatting'; import type { StudyTarget } from '@/lib/game/types'; interface StudyProgressProps { currentStudyTarget: StudyTarget | null; skills: Record; studySpeedMult: number; cancelStudy: () => void; } export function StudyProgress({ currentStudyTarget, skills, studySpeedMult, cancelStudy, }: StudyProgressProps) { if (!currentStudyTarget) return null; const target = currentStudyTarget; const progressPct = Math.min(100, (target.progress / target.required) * 100); const isSkill = target.type === 'skill'; const def = isSkill ? SKILLS_DEF[target.id] : SPELLS_DEF[target.id]; const currentLevel = isSkill ? (skills[target.id] || 0) : 0; return (
{def?.name} {isSkill && ` Lv.${currentLevel + 1}`}
{formatStudyTime(target.progress)} / {formatStudyTime(target.required)} {studySpeedMult.toFixed(1)}x speed
); }