import HandTools from "@/components/articles/HandTools";
import IterationsTab from "@/components/articles/IterationsTab";
import { readArticleIterations, readPolicy, readToday, type PolicyView } from "@/lib/articles/generation";
// The Iterations tab's server half (release 27 S8): the article's iterations
// as the store has them, the policy and the day's spend as the editor has
// them (null when the editor does not answer: the list still reads). Above
// them, what a person does by hand (release 32 R2, HandTools): it needs
// neither the editor nor a model.
export default async function IterationsView({ article, heard = null }: { article: string; heard?: string | null }) {
const initial = await readArticleIterations(article);
let policy: PolicyView | null = null;
try {
policy = await readPolicy();
} catch {
policy = null;
}
const today = policy ? await readToday(policy.generation.caps.daily).catch(() => null) : null;
const bases = initial.iterations
.filter((r) => r.status === "done" && r.hasReport)
.map((r) => ({ n: r.n, label: r.label, kind: r.kind, current: r.currentReport || initial.current.reportFrom === r.n }));
const initialBase = initial.current.reportFrom ?? bases[0]?.n ?? null;
return (
<>
>
);
}