);
}
function NextSteps({ checklistPercent, savedTemplates, connected, monitored, onNavigate }: {
checklistPercent: number;
savedTemplates: Set;
connected: boolean;
monitored: number;
onNavigate: (page: Page) => void;
}) {
const hasDisclosure = savedTemplates.has('vulnerability-disclosure-policy') || savedTemplates.has('security-txt');
const steps = [
{
title: 'Check that the CRA applies to you',
text: 'Plugins and themes supplied in the course of a commercial activity are in scope. Free software outside a commercial activity is not.',
done: false,
action: Applicability checker,
},
{
title: 'Publish a way to report vulnerabilities',
text: 'A disclosure policy and a security contact, for example in security.txt.',
done: hasDisclosure,
action: ,
},
{
title: 'Be ready to report within 24 hours',
text: 'Write an incident response plan and set up access to ENISA\'s Single Reporting Platform.',
done: savedTemplates.has('incident-response-plan'),
action: ,
},
{
title: 'Monitor the plugins you ship',
text: connected
? monitored > 0 ? `${plural(monitored, 'plugin is', 'plugins are')} monitored for known vulnerabilities.` : 'Add your plugin and the plugins it depends on.'
: 'Connect an account to check them against known vulnerabilities.',
done: connected && monitored > 0,
action: ,
},
{
title: 'Work through the checklist',
text: `${checklistPercent}% done. It runs from scope and reporting to the requirements that apply from December 2027.`,
done: checklistPercent === 100,
action: ,
},
];
return (
{steps.map((step, index) => (
{step.done ? '✓' : index + 1}
{step.title}
{step.done && (done)}
{step.text}
{step.action}
))}
);
}
const READINESS_LABELS: Record = {
overdue: 'Incidents past a reporting deadline',
critical: 'Open critical vulnerabilities',
high: 'Open high vulnerabilities',
medium: 'Open medium vulnerabilities',
};
/**
* The score comes from the service. The breakdown uses the service's own lines
* when it sends them, and otherwise the same shared formula. If the two ever
* disagree (the service changed its formula after this version shipped), the
* points are left out and only the counts are shown, so the panel never
* contradicts the score.
*/
function ScorePanel({ stats }: { stats: AccountStats }) {
const computed = computeReadiness(stats);
const lines = stats.readiness_lines ?? computed.lines;
const pointsKnown = Boolean(stats.readiness_lines) || computed.score === stats.compliance_score;
const active = lines.filter((line) => line.count > 0);
return (