import { useEffect, useState } from "react";
import {
WarningCircle,
CircleNotch,
FileText,
Info,
} from "@phosphor-icons/react";
import type { Fact, Provenance } from "../lib/api";
export const ICON = { size: 16, weight: "regular" as const };
/** Error state. Inline, specific, never a bare "something went wrong". */
export function ErrorNote({ message, onRetry }: { message: string; onRetry?: () => void }) {
return (
{message}
{onRetry && (
)}
);
}
/** Loading state shaped like the table it replaces, not a spinner in a void. */
export function TableSkeleton({ rows = 8 }: { rows?: number }) {
return (
);
}
/** Provenance rendered as a list, used in the ledger drawer. */
export function ProvenanceList({ provenance }: { provenance: Provenance[] }) {
return (
{provenance.map((p, i) => (
{p.source_title}
{p.locator}
{p.raw_line &&
{p.raw_line}
}
))}
);
}
export function StatusChip({ status }: { status: string }) {
return {status};
}
export function factTone(f: Fact): string {
return f.status;
}
export { Info };