Insight ledger
ProThe executive summary, in the three states it can honestly be in: not run yet; partial (some sections couldn't be computed, named); or ready, with counts by severity and the few findings that matter most.
Preview
Install
With the Candor CLI
First time? Get started sets up the registry and theme. Or with shadcn directly: npx shadcn@latest add @candor/insight-ledger
Brings in: data, finding, locale, utils · npm: lucide-react@^1.67.0
Usage
"use client"
import { InsightLedger } from "@/components/insight-ledger"
import type { Finding } from "@/lib/data"
const findings: Finding[] = [
{ id: "f1", severity: "critical", title: "Billing tests fail on the new discount rules", body: "Three tests fail when an invoice mixes annual and monthly discounts.", evidence: [{ label: "billing.test.ts", detail: "3 failures" }] },
{ id: "f2", severity: "serious", title: "No rollback for the plan_tier rename", body: "Migration 0136 rewrites rows and has no down migration.", evidence: [{ label: "6,031 rows", detail: "would change" }] },
{ id: "f3", severity: "warning", title: "Two dashboards still read legacy_score", body: "This release drops the column.", evidence: [{ label: "Weekly health" }, { label: "Churn review" }] },
{ id: "f4", severity: "info", title: "The dark-mode flag is at 100% everywhere", body: "Safe to remove.", evidence: [{ label: "dark-mode" }] },
]
export default function Example() {
return (
<InsightLedger
className="max-w-2xl"
state="partial"
headline="Ready to ship except billing: three tests fail on mixed discounts, and one migration can’t be undone."
findings={findings}
notComputed={[{ section: "User impact", reason: "needs session analytics, which isn’t connected for Production" }]}
/>
)
}<InsightLedger>
| Prop | Type | Default | Description |
|---|---|---|---|
| staterequired | "not-run" | "partial" | "ready" | — | not-run before the checks have run; partial when some sections couldn't be computed (listed in `notComputed`); ready otherwise. |
| headline | string | undefined | — | One or two sentences, from the report's own findings. |
| findings | Finding[] | undefined | [] | The report's findings; counted by severity, and the three most severe are shown. |
| notComputed | { section: string; reason: string }[] | undefined | [] | Sections that couldn't be computed, and why. |
| className | string | undefined | — | Extra classes for the outer element. |
Strings
The fixed words, in English by default. Change any of them under insightLedger in <LocaleProvider strings={{ … }}>; the table is exported as insightLedgerStrings.
| Key | English |
|---|---|
| notRun | No summary yet. It’s written once the report’s checks have run. |
| summaryOfFindings | Summary of findings |
| summary | Summary |
| countCritical | critical |
| countSerious | serious |
| countWarning | warning |
| countInfo | note |
| critical | Critical |
| serious | Serious |
| warning | Warning |
| info | Note |
| notComputed | Not computed |