papertrail/components/help/CategoryList.tsx
caelum0x 695a365ae4 feat: PaperTrail — enterprise evidence-verification platform
Multi-tenant platform (182 pages, 228 API routes, ~30 modules) built on a
deterministic verification core: clinical-trial claims checked against
ClinicalTrials.gov registered results and raw event counts (ARR/NNT/RR+CI
recomputed in code, oracle-tested), code-enforced exact-span grounding, and
multi-source cross-verification. Auth/RBAC/multi-tenancy, document processing
at scale (unpdf + Docling), agentic workflows, Claude Science connector,
compliance/audit, billing, public API, and more.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-08 07:21:22 +03:00

48 lines
1.4 KiB
TypeScript

"use client";
// Sidebar list of KB categories with counts. Highlights the active category and
// exposes an "All" reset. Presentational: state lives in the parent page.
import type { HelpCategoryDto } from "@/app/console/help/api";
export function CategoryList({
categories,
active,
totalCount,
onSelect,
}: {
categories: HelpCategoryDto[];
active: string | null;
totalCount: number;
onSelect: (category: string | null) => void;
}) {
return (
<nav aria-label="Help categories" className="space-y-1">
<button
onClick={() => onSelect(null)}
className={`w-full flex items-center justify-between rounded px-3 py-2 text-sm ${
active === null
? "bg-accent/10 text-accent"
: "text-ink/60 hover:bg-paper"
}`}
>
<span>All articles</span>
<span className="text-xs text-ink/40">{totalCount}</span>
</button>
{categories.map((c) => (
<button
key={c.category}
onClick={() => onSelect(c.category)}
className={`w-full flex items-center justify-between rounded px-3 py-2 text-sm capitalize ${
active === c.category
? "bg-accent/10 text-accent"
: "text-ink/60 hover:bg-paper"
}`}
>
<span>{c.category}</span>
<span className="text-xs text-ink/40">{c.count}</span>
</button>
))}
</nav>
);
}