import Link from 'next/link'; import { TOP_LEVEL_CANCERS } from '@cancerindex/ontology'; import { CommandPalette } from '@/components/layout/command-palette'; import { EmptyState } from '@/components/ui/empty-state'; import { Freshness } from '@/components/ui/freshness'; import { Section } from '@/components/ui/section'; import { Badge, ClaimBadge, ConfidenceBadge, StatusBadge } from '@/components/ui/badge'; import { getSiteCounts, getRareSpotlight } from '@/lib/queries/stats'; import { previewSnapshot } from '@/lib/queries/rankings'; import { mostActiveResearch, mostCuratedEvidence } from '@/lib/queries/trials'; import { resolveTopLevel } from '@/lib/queries/cancers'; import { listSources } from '@/lib/queries/sources'; import { fmtInt, fmtValue, fmtDate, scopeLabel, unitLabel, humanize, parseScopeKey } from '@/lib/format'; import { BurdenModule } from '@/components/home/burden-module'; import { RisingModule } from '@/components/home/rising-module'; import { GapsModule } from '@/components/home/gaps-module'; export const revalidate = 900; export default async function HomePage() { const [counts, spotlight, preview, active, curated, sources] = await Promise.all([ getSiteCounts(), getRareSpotlight(), previewSnapshot(['mortality_count', 'incidence_count', 'as_mortality_rate', 'active_trials', 'publications_5y', 'curated_evidence_items']), mostActiveResearch(8), mostCuratedEvidence(8), listSources(), ]); const topLevel = await resolveTopLevel(TOP_LEVEL_CANCERS.map((t) => t.ncit)); const topMatched = TOP_LEVEL_CANCERS.filter((t) => topLevel.has(t.ncit)).length; const ticker: Array<{ label: string; value: number; note: string; href: string }> = [ { label: 'Cancers indexed', value: counts.cancers, note: 'active malignant disease entities', href: '/cancers?malignant=1' }, { label: 'Subtypes', value: counts.subtypes, note: 'histologic and molecular subtypes', href: '/cancers?entity_type=subtype' }, { label: 'Genes', value: counts.genes, note: 'HGNC gene records', href: '/genes' }, { label: 'Variants', value: counts.variants, note: 'distinct variant entities', href: '/genes' }, { label: 'Clinical trials', value: counts.trials, note: 'ClinicalTrials.gov studies ingested', href: '/trials' }, { label: 'Publications', value: counts.publications, note: 'PubMed records linked', href: '/search' }, { label: 'Sources', value: counts.sources, note: `${counts.activeSources} active connector${counts.activeSources === 1 ? '' : 's'}`, href: '/sources' }, ]; return (
{/* Hero */}

Provenance-first oncology intelligence

CancerIndex — The global index of cancer.

Every recognized malignant disease entity — taxonomy, epidemiology, genomics, variants, therapies, trials, literature and transparent rankings — with a source, a date and a formula version on every number.

Try glioma, KRAS, osimertinib or an NCT number.

{/* Ticker */}
{/* Cancer burden (US, latest year) — §105 "Cancer burden today" */} {/* Rankings preview */}
All rankings → } > {preview ? ( <> {!preview.metric.slug.match(/incidence|mortality|survival/) ? (

No epidemiology-based ranking has been computed yet (awaiting licensed burden data). Showing the research-activity ranking instead — it measures registered activity, not disease burden.

) : null}
{preview.rows.map((r) => ( ))}
# Cancer {preview.metric.name} ({unitLabel(preview.metric.unit)}) Confidence
{r.rank} {r.canonical_name} {fmtValue(r.value, r.unit)}
Full table, methodology and "Why this rank?" →
) : ( Ranking snapshots are produced by the ranking engine once counters and licensed epidemiology observations are available. Nothing is shown until a snapshot exists with a scope, a formula version and an inputs hash.
Read how rankings are computed
)}
{/* Fastest-rising incidence (derived on the fly, §105/§328) */} {/* Largest trial / research gaps (§105, §265-266) */} {/* Active research */}
{active.length ? ( <>
{active.map((r) => ( ))}
Cancer Active trials (count) Recruiting (count)
{r.canonical_name} {fmtInt(r.active_trial_count)} {fmtInt(r.recruiting_trial_count)}
) : ( No clinical trials have been ingested yet; trial counters are computed from ClinicalTrials.gov conditions mapped to the taxonomy.
Trials explorer
)}
{/* Curated evidence */}
{curated.length ? ( <>
{curated.map((r) => ( ))}
Cancer Evidence items (count) Genes (count)
{r.canonical_name} {fmtInt(r.evidence_count)} {fmtInt(r.gene_count)}
) : ( No curated evidence items have been ingested yet. CIViC evidence will appear here grouped by cancer, with native evidence levels and directions. )}
); }