import { useState } from 'react'; import { Users, Plus, Star, Briefcase } from 'lucide-react'; import { useGameStore } from '@/store'; import { formatMoney } from '@ai-tycoon/shared'; import { KEY_HIRE_POOL } from '@ai-tycoon/game-engine'; import type { DepartmentId } from '@ai-tycoon/shared'; const DEPT_LABELS: Record = { research: 'Research', engineering: 'Engineering', operations: 'Operations', sales: 'Sales', }; const DEPT_DESCRIPTIONS: Record = { research: 'Improves R&D speed and model quality', engineering: 'Faster training and better infrastructure', operations: 'Lower costs and higher uptime', sales: 'More enterprise contracts and revenue', }; export function TalentPage() { const departments = useGameStore((s) => s.talent.departments); const keyHires = useGameStore((s) => s.talent.keyHires); const totalSalary = useGameStore((s) => s.talent.totalSalaryPerTick); const money = useGameStore((s) => s.economy.money); const era = useGameStore((s) => s.meta.currentEra); const hireDepartment = useGameStore((s) => s.hireDepartment); const [showKeyHires, setShowKeyHires] = useState(false); const hiringCost = 2000; const canHire = money >= hiringCost; const eraOrder = ['startup', 'scaleup', 'bigtech', 'agi']; const currentEraIdx = eraOrder.indexOf(era); const availableKeyHires = KEY_HIRE_POOL.filter(h => { const hireEraIdx = eraOrder.indexOf(h.requiredEra); if (hireEraIdx > currentEraIdx) return false; return !keyHires.some(kh => kh.id === h.id); }); return (

Talent

Total Salary: {formatMoney(totalSalary)}/s
{Object.entries(departments).map(([id, dept]) => (

{DEPT_LABELS[id]}

{DEPT_DESCRIPTIONS[id]}

{dept.headcount}
employees
Budget: {formatMoney(dept.budget)}/mo
{!canHire &&
Insufficient funds
}
))}

Key Hires

{keyHires.length > 0 && (
{keyHires.map(hire => (
{hire.name}
{DEPT_LABELS[hire.department]} · {hire.specialAbility}
{formatMoney(hire.salary)}/s
))}
)} {showKeyHires && (
{availableKeyHires.length > 0 ? availableKeyHires.map(hire => (
{hire.name}
{hire.description}
{DEPT_LABELS[hire.department]} · {formatMoney(hire.salary)}/s
)) : (

No key hires available in current era

)}
)} {keyHires.length === 0 && !showKeyHires && (

No key hires recruited yet.

)}
); } function StatBar({ label, value }: { label: string; value: number }) { return (
{label}
0.7 ? 'bg-success' : value > 0.4 ? 'bg-warning' : 'bg-danger'}`} style={{ width: `${value * 100}%` }} />
{Math.round(value * 100)}%
); }