import Link from "next/link"; import AppHeader from "@/components/shell/AppHeader"; import AppRail from "@/components/shell/AppRail"; import CasePipeline from "@/components/research/CasePipeline"; import { EmptyState } from "@/components/ui/empty-state"; import { pipelineView } from "@/lib/research/pipeline"; import { researchCaseHref, researchHref } from "@/lib/research/hrefs"; import type { PipelineView } from "@/lib/research/pipeline-types"; import { verifyView } from "@/lib/research/case-verify"; import { leadsView } from "@/lib/research/case-leads"; import { evidenceView } from "@/lib/research/case-evidence"; import type { CaseStagePanels } from "@/components/research/stages/types"; export const dynamic = "force-dynamic"; // A CASE'S PIPELINE (plans/release-38/research-cases-and-assist.md, lane A), beside its board at // /research/: the stages -- define, coverage, candidates, batches, the read, merge, the privacy gate, // export and hand-off, date checks, and lane C's verify, leads and evidence -- each with its manual path and its buttons. The page is the client's // (components/research/CasePipeline.tsx); this reads the first frame. export default async function CasePipelinePage({ params, searchParams }: { params: Promise<{ case: string }>; searchParams: Promise<{ leads?: string }> }) { const { case: raw } = await params; const { leads: leadsChannel } = await searchParams; const id = decodeURIComponent(raw); let view: PipelineView | null = null; let error: { status: number; message: string } | null = null; let panels: CaseStagePanels | null = null; try { view = await pipelineView(id); // Lane C's stages (verify, leads, evidence): each read on its own, so one that cannot be read says so in its // panel and the rest of the page stands. const said = (e: unknown) => ({ error: (e as Error).message }); const [verify, leads, evidence] = await Promise.all([ verifyView(id).catch(said), leadsView(id, leadsChannel ?? null).catch(said), evidenceView(id).catch(said), ]); panels = { verify, leads, evidence }; } catch (e) { error = { status: (e as { status?: number }).status ?? 500, message: (e as Error).message }; } return (
{view ? ( ) : ( <>
{error?.message}{" "} Research
)}
); }