import React, { useEffect, useState } from 'react'; import "./styles/SkillsTab.css"; const SkillsTab = () => { const [category, setCategory] = useState('combat'); const categories = [ { id: 'combat', label: 'Combat' }, { id: 'science', label: 'Science' }, { id: 'crafting', label: 'Crafting' } ]; const [skillsData] = useState(() => { const catIds = categories.map(c => c.id); return Array.from({ length: 5 }, (_, i) => ({ id: `skill-${i}`, category: catIds[i % catIds.length], name: `Tech ${i + 1}`, currentLevel: i < 3 ? 1 : 0, maxLevel: 10, experience: 20, experienceToNext: 100, description: "Specialized module for advanced space operations.", iconClass: i % 3 === 0 ? "fa-shield-alt" : i % 3 === 1 ? "fa-flask" : "fa-tools", unlocked: i < 3, requiredLevel: 1 })); }); const handleUnlock = (category, id) => { console.log(`Unlocking ${id} in ${category}`); }; const handleUpgrade = (category, id) => { console.log(`Upgrading ${id} in ${category}`); }; const filteredSkills = skillsData.filter(skill => skill.category === category); return (

Skills

Skill Points: 0
{categories.map(cat => ( ))}
{filteredSkills.length > 0 ? ( filteredSkills.map(skill => ( console.log('Unlock', cat, id)} onUpgrade={(cat, id) => console.log('Upgrade', cat, id)} /> )) ) : (

No skills discovered in this category yet.

)}
); }; const SkillComponent = ({ skill, activeCategory, skillId, onUnlock, onUpgrade, }) => { const { name, currentLevel, maxLevel, description, iconClass, experience, experienceToNext, unlocked, requiredLevel } = skill; const progressPercent = (experience / experienceToNext) * 100; return (
{name}
Lv. {currentLevel}/{maxLevel}
{description}
{unlocked && currentLevel < maxLevel && (
{experience}/{experienceToNext} XP
)} {currentLevel >= maxLevel && (
MAX LEVEL REACHED
)}
{!unlocked ? ( ) : currentLevel < maxLevel ? ( ) : ( Mastered )}
{!skill.unlocked ?
Requires Level {skill.requiredLevel}
: ''}
); }; export default SkillsTab;