import { Check, Csrf, Field, Select } from "@/components/admin-ui"; import type { taxonomy } from "@/lib/admin/queries"; type Tax = Awaited>; const dateStr = (d: string | null | undefined, p: string | undefined) => (!d ? "" : p === "year" ? String(d).slice(0, 4) : p === "month" ? String(d).slice(0, 7) : String(d).slice(0, 10)); export function PaperForm({ p, tax, csrf, action }: { p: Record | null; tax: Tax; csrf: string; action: (f: FormData) => Promise }) { const sel = (k: string) => new Set(((p?.[k] as { id: number }[]) ?? []).map((x) => x.id)); const j = (v: unknown) => (v ? JSON.stringify(v, null, 1) : ""); return (
{p && }

Topics and domains

{tax.topics.map((t) => )}

Methods

{tax.methods.map((m) => )}

Datasets

{tax.datasets.map((d) => )}
); }