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, StatusBadge } from '@/components/ui/badge'; import { SourceBadge } from '@/components/ui/source-badge'; import { recentApprovals } from '@/lib/queries/approvals'; import { fmtDate, toDate } from '@/lib/format'; /** * Home module "New oncology approvals": the last dated approval records across every ingested * authority (one record = one authority's decision for one application/DIN — never a bare * "approved"). Regulatory claim label; source badge per row because authorities differ. */ export async function ApprovalsModule({ limit = 8 }: { limit?: number }) { const rows = await recentApprovals(limit); return (
Approvals feed → } > {rows.length === 0 ? ( No regulatory approval record has been ingested yet. ) : ( <>
{rows.map((a) => ( ))}
Date Drug Authority Cancer Status Source
{fmtDate(a.approval_date)} {a.drug_name} {a.approval_type ? {a.approval_type} : null} {a.authority} {a.jurisdiction} {a.tumor_agnostic ? Tumor-agnostic : null} {a.cancer_slug ? ( {a.cancer_name} ) : !a.tumor_agnostic ? ( not stated in this record ) : null}
Jurisdiction-specific and time-bound; not a treatment recommendation.
toDate(r.updated_at)).filter((d): d is Date => !!d).sort((a, b) => b.getTime() - a.getTime())[0] ?? null} sourceUpdatedAt={rows[0]?.approval_date ?? null} /> )}
); }