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>
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
"use client";
|
|
|
|
import type { PersonalToken } from "@/lib/account/types";
|
|
import { Button } from "@/components/account/fields";
|
|
|
|
function formatDate(iso: string | null): string {
|
|
if (!iso) return "Never";
|
|
const d = new Date(iso);
|
|
return Number.isNaN(d.getTime()) ? "—" : d.toLocaleDateString();
|
|
}
|
|
|
|
interface TokenRowProps {
|
|
token: PersonalToken;
|
|
revoking: boolean;
|
|
onRevoke: (id: string) => void;
|
|
}
|
|
|
|
// One personal access token row: name, when it was created, and when it was last
|
|
// used (so stale tokens are easy to spot), plus a revoke action.
|
|
export function TokenRow({ token, revoking, onRevoke }: TokenRowProps) {
|
|
return (
|
|
<li className="flex items-center justify-between gap-4 px-5 py-3">
|
|
<div className="min-w-0">
|
|
<p className="truncate text-sm font-medium text-ink/80">{token.name}</p>
|
|
<p className="truncate text-xs text-ink/40">
|
|
Created {formatDate(token.createdAt)} · Last used{" "}
|
|
{formatDate(token.lastUsedAt)}
|
|
</p>
|
|
</div>
|
|
<Button
|
|
variant="danger"
|
|
disabled={revoking}
|
|
onClick={() => onRevoke(token.id)}
|
|
>
|
|
{revoking ? "Revoking…" : "Revoke"}
|
|
</Button>
|
|
</li>
|
|
);
|
|
}
|