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>
50 lines
1.4 KiB
TypeScript
50 lines
1.4 KiB
TypeScript
"use client";
|
|
|
|
import { useCallback, useState } from "react";
|
|
|
|
interface SecretRevealProps {
|
|
title: string;
|
|
hint: string;
|
|
secret: string;
|
|
onDismiss: () => void;
|
|
}
|
|
|
|
// One-time secret display with a copy button. Used after creating an API key
|
|
// (and reusable for any create-once credential) — the full value is shown once.
|
|
export function SecretReveal({ title, hint, secret, onDismiss }: SecretRevealProps) {
|
|
const [copied, setCopied] = useState(false);
|
|
|
|
const onCopy = useCallback(async () => {
|
|
try {
|
|
await navigator.clipboard.writeText(secret);
|
|
setCopied(true);
|
|
} catch {
|
|
setCopied(false);
|
|
}
|
|
}, [secret]);
|
|
|
|
return (
|
|
<div className="mt-4 bg-white border border-accent/40 rounded-lg p-5">
|
|
<p className="text-sm font-medium text-ink/80">{title}</p>
|
|
<p className="mt-1 text-xs text-ink/40">{hint}</p>
|
|
<div className="mt-3 flex items-center gap-2">
|
|
<code className="flex-1 text-xs bg-paper rounded px-3 py-2 break-all text-ink/80">
|
|
{secret}
|
|
</code>
|
|
<button
|
|
onClick={onCopy}
|
|
className="text-sm border border-ink/15 rounded px-3 py-2 hover:border-accent shrink-0"
|
|
>
|
|
{copied ? "Copied" : "Copy"}
|
|
</button>
|
|
</div>
|
|
<button
|
|
onClick={onDismiss}
|
|
className="mt-3 text-xs text-ink/40 hover:underline"
|
|
>
|
|
Dismiss
|
|
</button>
|
|
</div>
|
|
);
|
|
}
|