import type { KPI } from '@/types/pmr' interface KPIDetailProps { kpi: KPI } // Color map for KPI values const colorMap: Record = { green: '#059669', amber: '#D97706', teal: '#0D6E6E', } export function KPIDetail({ kpi }: KPIDetailProps) { // If story exists, render rich content; otherwise fallback to explanation if (!kpi.story) { return (
{kpi.value}

{kpi.explanation}

) } const { context, role, outcomes, period } = kpi.story return (
{/* Headline number */}
{kpi.value}
{kpi.label}
{kpi.sub}
{/* Period badge (if present) */} {period && (
{period}
)} {/* Context paragraph */}

Context

{context}

{/* Your role paragraph */}

Your Role

{role}

{/* Outcome bullets */}

Key Outcomes

    {outcomes.map((outcome, index) => (
  • {outcome}
  • ))}
) }