Files
Mana-Loop/src/components/game/SkillsTab.tsx
T
Refactoring Agent d2d28887b1
Build and Publish Mana Loop Docker Image / build-and-publish (push) Failing after 1m9s
Refactor large files into modular components
- Refactored page.tsx (613→252 lines) with GameOverScreen and LeftPanel extracted
- Refactored StatsTab.tsx (584→92 lines) with section components
- Refactored SkillsTab.tsx (434→54 lines) with sub-components
- Created modular structure for GameContext, LootInventory, and other components
- All extracted components organized into feature directories
2026-05-02 17:35:03 +02:00

55 lines
1.6 KiB
TypeScript
Executable File

'use client';
import { useState } from 'react';
import { useGameStore } from '@/lib/game/store';
import { SKILL_CATEGORIES } from '@/lib/game/constants';
import { Card, CardContent } from '@/components/ui/card';
import { SkillUpgradeDialog } from './SkillsTab/SkillUpgradeDialog';
import { SkillStudyProgress } from './SkillsTab/SkillStudyProgress';
import { SkillCategory } from './SkillsTab/SkillCategory';
export function SkillsTab() {
const store = useGameStore();
const [upgradeDialogSkill, setUpgradeDialogSkill] = useState<string | null>(null);
const [upgradeDialogMilestone, setUpgradeDialogMilestone] = useState<5 | 10>(5);
const handleUpgradeClick = (skillId: string, milestone: 5 | 10) => {
setUpgradeDialogSkill(skillId);
setUpgradeDialogMilestone(milestone);
};
const handleUpgradeClose = () => {
setUpgradeDialogSkill(null);
};
return (
<div className="space-y-4">
{/* Upgrade Selection Dialog */}
<SkillUpgradeDialog
skillId={upgradeDialogSkill}
milestone={upgradeDialogMilestone}
onClose={handleUpgradeClose}
/>
{/* Current Study Progress */}
{store.currentStudyTarget && store.currentStudyTarget.type === 'skill' && (
<Card className="bg-gray-900/80 border-purple-600/50">
<CardContent className="pt-4">
<SkillStudyProgress />
</CardContent>
</Card>
)}
{SKILL_CATEGORIES.map((cat) => (
<SkillCategory
key={cat.id}
categoryId={cat.id}
onUpgradeClick={handleUpgradeClick}
/>
))}
</div>
);
}
SkillsTab.displayName = "SkillsTab";