/* ============================================================
RESULTADO INDIVIDUAL — Dashboard de la persona
Incluye 3 variaciones de composición (Editorial · Tablero · Enfoque)
Exporta: ScreenResult
============================================================ */
const IHR = window.IH;
function ScreenResult({ profile, scores, onRestart, onExec, onPDF }) {
const [variant, setVariant] = React.useState('editorial');
const diag = IHR.diagnose(scores);
const reco = IHR.recommend(scores);
const dom = IHR.byId[diag.dominant];
return (
{/* header */}
Panel ejecutivo
Exportar PDF
{/* encabezado de identidad */}
Radiografía conductual individual
{profile.nombre || 'Colaborador'}
{[profile.puesto, profile.area, profile.empresa, profile.antiguedad].filter(Boolean).map((t, i) => (
{t}
))}
{new Date().toLocaleDateString('es-MX', { day: '2-digit', month: 'long', year: 'numeric' })}
{/* frase diagnóstica — el diferenciador */}
{variant === 'editorial' &&
}
{variant === 'tablero' &&
}
{variant === 'enfoque' &&
}
{/* INTERPRETACIÓN */}
{/* RECOMENDACIONES */}
{/* pie */}
Este mapa describe qué arquetipo gobierna hoy tus decisiones. No es una calificación ni una etiqueta permanente: es una fotografía del momento, y se puede transformar.
↺ Nueva evaluación
);
}
/* —— Switch de variante —— */
function VariantSwitch({ value, onChange }) {
const opts = [['editorial', 'Editorial'], ['tablero', 'Tablero'], ['enfoque', 'Enfoque']];
return (
{opts.map(([k, l]) => (
onChange(k)} style={{ border: 'none', cursor: 'pointer', fontFamily: 'var(--sans)', fontSize: 12, fontWeight: 500,
padding: '6px 13px', borderRadius: 6, transition: 'all .15s',
background: value === k ? 'var(--panel)' : 'transparent', color: value === k ? 'var(--ink)' : 'var(--ink-3)',
boxShadow: value === k ? 'var(--shadow)' : 'none' }}>{l}
))}
);
}
/* —— Frase diagnóstica automática (pull-quote) —— */
function DiagnosticHeadline({ scores }) {
const d = IHR.diagnosticLine(scores);
const accentColor = d.strong ? 'var(--risk)' : 'var(--gold)';
return (
Lectura inmediata
{d.lead}{d.strong ? '… ' : ' '}
{d.turn}
);
}
/* —— Diagnóstico principal (reutilizable) —— */
function DiagPrincipal({ diag, dom, big }) {
return (
Actualmente operas principalmente desde
Arquetipos secundarios
{diag.secondary.map(id => {
const a = IHR.byId[id];
return (
{a.name}
);
})}
);
}
/* —— Card contenedor —— */
function Panel({ children, style, title, sub }) {
return (
);
}
/* ============== VARIANTE A · EDITORIAL ============== */
function VariantEditorial({ scores, diag, dom }) {
return (
Mapa conductual
6 arquetipos · % independiente
);
}
/* ============== VARIANTE B · TABLERO ============== */
function VariantTablero({ scores, diag, dom }) {
return (
);
}
/* ============== VARIANTE C · ENFOQUE ============== */
function VariantEnfoque({ scores, diag, dom }) {
return (
{/* panel de color con el arquetipo dominante */}
Operas principalmente desde
{dom.name}
{dom.glyph}
{diag.evolIndex}
ÍNDICE DE EVOLUCIÓN
{diag.secondary.map(id => (
{IHR.byId[id].name}
))}
{/* radar */}
);
}
/* —— Interpretación —— */
function Interpretacion({ dom, diag }) {
const t = IHR.interpret[dom.id];
return (
{t.desc}
);
}
function InterpCol({ title, color, items }) {
return (
{title}
{items.map((it, i) => (
{it}
))}
);
}
/* —— Recomendaciones —— */
function RecoSection({ reco }) {
const cols = [
{ k: 'urgente', label: 'Acciones urgentes', color: 'var(--risk)', tone: 'oklch(0.56 0.13 28 / 0.08)' },
{ k: 'importante', label: 'Acciones importantes', color: 'var(--warn)', tone: 'oklch(0.70 0.11 70 / 0.10)' },
{ k: 'mejora', label: 'Mejora continua', color: 'var(--good)', tone: 'oklch(0.60 0.09 150 / 0.08)' },
];
return (
{cols.map(c => {
const items = reco[c.k] || [];
return (
{c.label}
{items.length}
{items.length ? (
{items.map((it, i) => (
{IHR.byId[it.archetype].name}
{it.text}
))}
) :
Sin acciones en este nivel.
}
);
})}
);
}
Object.assign(window, { ScreenResult, Panel, DiagPrincipal });