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 { Badge, ClaimBadge } from '@/components/ui/badge'; import { SourceBadge } from '@/components/ui/source-badge'; import { getGeographyBySlug, cagrFor, CAGR_FORMULA, CAGR_FORMULA_VERSION } from '@/lib/queries/geography'; import { fmtNum, fmtValue, fmtInt, toDate } from '@/lib/format'; /** * Home module "Fastest-rising incidence" (§105, §328): ASIR compound annual growth rate over the last ten * available years, computed on the fly from observations. Shown only when ≥ 10 years exist; labelled as * derived, with the formula and both endpoints on every row so the number can be reproduced. */ export async function RisingModule({ slug = 'united-states', limit = 8 }: { slug?: string; limit?: number }) { const geo = await getGeographyBySlug(slug); const res = geo ? await cagrFor(geo.id, 'as_incidence_rate', 'all', 10) : null; const rows = res?.rows.slice(0, limit) ?? []; const first = rows[0]; return (
Trend chart → ) : undefined } > {!res || rows.length === 0 ? ( A 10-year growth rate is computed only when at least ten distinct years of age-standardized incidence exist for the geography{res ? ` (${res.yearsAvailable} available)` : ''}. Nothing is extrapolated from shorter series. ) : ( <>
{rows.map((r) => ( ))}
Cancer CAGR (%/yr) {res.startYear} (per 100,000) {res.endYear} (per 100,000) Years
{r.canonical_name} {r.estimate_types.some((t) => t !== 'observed') ? includes estimates : null} 0 ? 'text-danger' : r.cagr < 0 ? 'text-ok' : ''}`}> {r.cagr > 0 ? '+' : ''} {fmtNum(r.cagr * 100, 2)} {fmtValue(r.start_value, r.unit)} {fmtValue(r.end_value, r.unit)} {fmtInt(r.n_years)}
{first ? : null} formula: {CAGR_FORMULA} {CAGR_FORMULA_VERSION} {first?.standard_population ? standard: {first.standard_population} : null}

Rising incidence can reflect true risk changes, screening or diagnostic practice, coding changes or population ageing beyond what standardization removes; the rate says nothing about causes. Falling rates are listed on the methodology page definition.

toDate(r.updated_at)).filter((d): d is Date => !!d).sort((a, b) => b.getTime() - a.getTime())[0] ?? null} sourceVersion={`${res.startYear}–${res.endYear}`} extra={`${fmtInt(res.rows.length)} cancers with a complete 10-year series`} /> )}
); }