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>
44 lines
1.4 KiB
TypeScript
44 lines
1.4 KiB
TypeScript
"use client";
|
|
|
|
import type { WidgetKind } from "./types";
|
|
import { WIDGET_KIND_LABELS } from "./shared";
|
|
|
|
interface WidgetPaletteProps {
|
|
adding: boolean;
|
|
onAdd: (kind: WidgetKind) => void;
|
|
}
|
|
|
|
const KIND_DESCRIPTIONS: Record<WidgetKind, string> = {
|
|
metric: "A single KPI number (claims verified, trust score, distortion rate).",
|
|
list: "Recent claims, documents, or verifications.",
|
|
chart: "A bar chart series over time or by category.",
|
|
};
|
|
|
|
const KINDS: WidgetKind[] = ["metric", "list", "chart"];
|
|
|
|
// Palette of widget kinds that can be dropped onto the grid.
|
|
export function WidgetPalette({ adding, onAdd }: WidgetPaletteProps) {
|
|
return (
|
|
<div className="rounded-lg border border-ink/15 bg-white p-4">
|
|
<h2 className="text-sm font-semibold text-ink/70">Add widget</h2>
|
|
<div className="mt-3 space-y-2">
|
|
{KINDS.map((kind) => (
|
|
<button
|
|
key={kind}
|
|
onClick={() => onAdd(kind)}
|
|
disabled={adding}
|
|
className="w-full rounded-md border border-ink/15 px-3 py-2 text-left hover:border-accent hover:bg-paper disabled:opacity-40"
|
|
>
|
|
<span className="block text-sm font-medium text-ink/70">
|
|
{WIDGET_KIND_LABELS[kind]}
|
|
</span>
|
|
<span className="mt-0.5 block text-xs text-ink/40">
|
|
{KIND_DESCRIPTIONS[kind]}
|
|
</span>
|
|
</button>
|
|
))}
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|