import Link from 'next/link'; import { Section } from '@/components/ui/section'; import { EmptyState } from '@/components/ui/empty-state'; import { Freshness } from '@/components/ui/freshness'; import { ClaimBadge } from '@/components/ui/badge'; import { topPhase3Recruiting } from '@/lib/queries/trial-intelligence'; import { fmtInt, fmtPct, toDate } from '@/lib/format'; import { fmtGrowth } from '@/lib/trial-intel'; /** * Home module "Clinical trial intelligence" (SPEC §10): the top-level cancers with the most recruiting * Phase III interventional studies, with registration growth and industry share. Every figure comes from * `trial_intelligence` (computed, formula-versioned); nothing is shown until the layer has been computed. */ export async function TrialIntelModule({ limit = 8 }: { limit?: number }) { const rows = await topPhase3Recruiting(limit); const computedAt = rows.reduce((m, r) => { const d = toDate(r.computed_at); return d && (!m || d > m) ? d : m; }, null); return (
All measures → } > {rows.length === 0 ? ( The per-cancer trial measures are derived from ClinicalTrials.gov records after each ingest. Nothing is shown until that computation has run. ) : ( <>
{rows.map((r, i) => ( ))}
# Cancer Ph III recruiting Active Growth YoY Industry
{i + 1} {r.cancer_name} {fmtInt(r.phase3_recruiting)} {fmtInt(r.active_trials)} 0 ? 'text-ok' : r.trial_growth_yoy != null && r.trial_growth_yoy < 0 ? 'text-danger' : ''}`} title={`${fmtInt(r.new_trials_12m)} first posted in the last 12 months vs ${fmtInt(r.new_trials_prior_12m)} in the preceding 12 months`}> {fmtGrowth(r.trial_growth_yoy)} {fmtPct(r.industry_share, 0)}

formula {rows[0]?.formula_version} · interventional studies · descendants included source: clinicaltrials Terminated studies

)}
); }