Insight ledger

Pro

The 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.

Markdown

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

TSX · The example above
"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>

PropTypeDefaultDescription
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.
headlinestring | undefined—One or two sentences, from the report's own findings.
findingsFinding[] | 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.
classNamestring | 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.

KeyEnglish
notRunNo summary yet. It’s written once the report’s checks have run.
summaryOfFindingsSummary of findings
summarySummary
countCriticalcritical
countSeriousserious
countWarningwarning
countInfonote
criticalCritical
seriousSerious
warningWarning
infoNote
notComputedNot computed