import type { PolicyProblemSummary as Summary } from '../../profiles/group-policy/problem-summary'; import { policyBaselinePackageLabel } from '../../profiles/group-policy/baseline-comparison-summary'; import { PathText } from '../../components/PathText/PathText'; import { highlightText } from '../../components/HighlightText/highlight-text'; /** First-read block: configured versus expected, who sets it, what the flags mean and the next step. */ export function PolicyProblemSummary({ summary, outcome, search }: { summary: Summary; outcome: string; search: string }) { return <>

{summary.heading}

{summary.configured.length > 0 &&
Configured
{summary.configured.map((entry, index) => { // Red: differs from every variant. Green: matches every variant. Neutral: depends on the template. const content = <>; return {entry.state ? {content} : content} {entry.note && ยท {entry.note}} ; })}
} {summary.expected.length > 0 &&
Expected
{summary.expected.map((item, index) => )}
} {summary.additional.length > 0 &&
Additional entries
{summary.additional.map((item, index) => )}
} {summary.missing.length > 0 &&
Missing entries
{summary.missing.map((item, index) => )}
}
{summary.context.map((line, index) =>

{highlightText(line, search)}

)} {summary.flags.map((line, index) =>

{highlightText(line, search)}

)}
{/* The next step is its own block so its marker stays distinct from the problem outcome. */} {(summary.nextSteps.length > 0 || summary.nextStepIntro) &&

Next step

{summary.nextStepIntro &&

{summary.nextStepIntro}

} {summary.nextSteps.map((group, index) =>

{summary.nextStepPackages &&

{highlightText(policyBaselinePackageLabel(group.packages, index === 0 && summary.nextSteps.length > 1), search)}

}
)} {summary.affectedSources.length > 0 &&

In: {highlightText(summary.affectedSources.join(', '), search)}

}
} ; }