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

97 lines
2.8 KiB
TypeScript

import Link from "next/link";
import type { Schedule } from "@/lib/jobs/types";
import { formatTime } from "./client";
interface SchedulesTableProps {
items: Schedule[];
onToggle: (schedule: Schedule) => void;
onDelete: (id: string) => void;
}
// Table of cron schedules with enable/disable and delete actions per row.
export function SchedulesTable({
items,
onToggle,
onDelete,
}: SchedulesTableProps) {
return (
<table className="w-full text-sm">
<thead>
<tr className="border-b border-ink/10 text-left text-xs text-ink/40">
<th className="px-4 py-2 font-medium">Name</th>
<th className="px-4 py-2 font-medium">Type</th>
<th className="px-4 py-2 font-medium">Cron</th>
<th className="px-4 py-2 font-medium">Enabled</th>
<th className="px-4 py-2 font-medium">Last run</th>
<th className="px-4 py-2 font-medium">Next run</th>
<th className="px-4 py-2" />
</tr>
</thead>
<tbody>
{items.map((s) => (
<ScheduleRow
key={s.id}
schedule={s}
onToggle={onToggle}
onDelete={onDelete}
/>
))}
</tbody>
</table>
);
}
function ScheduleRow({
schedule: s,
onToggle,
onDelete,
}: {
schedule: Schedule;
onToggle: (schedule: Schedule) => void;
onDelete: (id: string) => void;
}) {
return (
<tr className="border-b border-ink/10 last:border-0">
<td className="px-4 py-2 text-ink/80">
<Link
href={`/console/schedules/${s.id}`}
className="text-accent hover:underline"
>
{s.name}
</Link>
</td>
<td className="px-4 py-2 font-mono text-xs text-ink/80">{s.type}</td>
<td className="px-4 py-2 font-mono text-xs text-ink/60">{s.cron}</td>
<td className="px-4 py-2">
<span
className={`inline-block rounded-full border px-2 py-0.5 text-xs ${
s.enabled
? "border-green-200 bg-green-50 text-green-700"
: "border-ink/15 bg-paper text-ink/50"
}`}
>
{s.enabled ? "enabled" : "disabled"}
</span>
</td>
<td className="px-4 py-2 text-xs text-ink/50">{formatTime(s.lastRunAt)}</td>
<td className="px-4 py-2 text-xs text-ink/50">{formatTime(s.nextRunAt)}</td>
<td className="px-4 py-2 text-right">
<div className="flex justify-end gap-3">
<button
onClick={() => onToggle(s)}
className="text-xs text-accent hover:underline"
>
{s.enabled ? "Disable" : "Enable"}
</button>
<button
onClick={() => onDelete(s.id)}
className="text-xs text-red-700 hover:underline"
>
Delete
</button>
</div>
</td>
</tr>
);
}