The answer to "is anything wrong?" in one line, the problems named as links to where each is fixed.
<div id="v-ok" data-mount="ok"></div>
Installation
// package.json: "capsomer": "github:DrDustinEdwards/capsomer#v0.152.2"
import "capsomer/tokens.css";
import "capsomer/base.css";
import "capsomer/verdict.css";import "capsomer/tokens.css";
import "capsomer/verdict.css";
import { Verdict } from "capsomer/react/verdict";Usage
import { Verdict } from "capsomer/react/verdict";
<Verdict
problems={problems.map((p) => ({ key: p.key, tone: p.sev, label: <Link to={p.href}>{p.title}</Link> }))}
okNote="Sites, backups and default branches were fine on the last pass."
more={(n) => <Link to="/needs#attention">{n} more</Link>}
/>Examples
Problems by name, the rest as a link
<div id="v-problems" data-mount="problems"></div>
One warning
<div id="v-one" data-mount="one"></div>
Not known yet
<div id="v-unknown" data-mount="unknown"></div>
API reference
Verdict
| Prop | Type | Required | Does |
|---|---|---|---|
problems | VerdictProblem[] | Yes | |
okLabel | string | The words when there are none: "All good". | |
okNote | ReactNode | What all good means, after it: "Sites, backups and default branches were fine on the last pass." | |
noun | [string, string] | The singular and plural: ["problem", "problems"]. | |
named | number | How many are named; the rest are "and 4 more". | |
more | (rest: number) => ReactNode | The rest, as a link or button to the full list: (n) => <a href="/needs">{n} more</a>. | |
unknown | ReactNode | No answer yet (the data has not loaded or did not come): the verdict says so, never "All good". | |
className | string |
Parts and data attributes
| Class | Is |
|---|---|
.cap-verdict | the root |
.cap-verdict-list | a part |
.cap-verdict-note | a part |
Accessibility
A paragraph, so it is read in order; each named problem is a real link or button. The status word carries its glyph (shape, not color alone).