import { wowheadIcon, wowheadUrl, wowheadData } 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[] } export type GlyphInfo = { name: string; icon: string } export type TalentGroupView = { spec: string | null total: number dist: number[] trees: TalentTreeData[] glyphs: { major: GlyphInfo[]; minor: GlyphInfo[] } } /** * Renderiza UN grupo de talentos: cabecera de distribución + los 3 árboles (rejilla de * iconos) + una 4ª columna con los Glifos (mayores/menores). Componente puro sin estado, * usado por ArmoryTalentTab (que conmuta Primaria/Secundaria). */ export function ArmoryTalents({ group, spellIcons, locale, labels, }: { group: TalentGroupView spellIcons: Record locale: string labels: { distribution: string; groupLabel: string; glyphs: string; majorGlyphs: string; minorGlyphs: string } }) { const { trees, glyphs, dist } = group return (
{labels.distribution} · {labels.groupLabel.toUpperCase()}
{dist.join(' / ')}
{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} ) })}
) })}
{labels.glyphs} {glyphs.major.length} · {glyphs.minor.length}
{glyphs.major.length > 0 && (

{labels.majorGlyphs}

{glyphs.major.map((g, i) => (
{g.name}
))}
)} {glyphs.minor.length > 0 && (

{labels.minorGlyphs}

{glyphs.minor.map((g, i) => (
{g.name}
))}
)} {glyphs.major.length === 0 && glyphs.minor.length === 0 && (

)}
) }