import { wowheadUrl, wowheadData, wowheadIcon } from '@/lib/wowhead' export type TalentCell = { tier: number; col: number; rank: number; max: number; spell: number } export type TalentTreeData = { index: number; name: string; points: number; talents: TalentCell[] } /** * Árbol de talentos estilo calculador: 3 árboles, cada uno una rejilla de casillas * posicionadas por fila (tier) y columna. Cada casilla muestra el icono del talento * (del hechizo de rango 1) y su rango actual/máximo; las no aprendidas van atenuadas. * El icono va en un hijo porque wowhead sobrescribe el background del . */ export function ArmoryTalents({ trees, spec, total, maxPoints, locale, spellIcons, }: { trees: TalentTreeData[] spec: string | null total: number maxPoints: number locale: string spellIcons: Record }) { return (
{spec} {trees.map((tr) => tr.points).join(' / ')} {total} / {maxPoints}
{trees.map((tree) => { const maxTier = tree.talents.reduce((m, t) => Math.max(m, t.tier), 0) return (
{tree.name} {tree.points}
{tree.talents.map((tal) => { const icon = spellIcons[tal.spell] const state = tal.rank === 0 ? 'off' : tal.rank >= tal.max ? 'max' : 'on' return ( {icon ? ( ) : null} {tal.rank > 0 ? ( {tal.rank}/{tal.max} ) : null} ) })}
) })}
) }