import type { Metadata } from 'next'; import Link from 'next/link'; import { PageHeader } from '@/components/ui/section'; import { EmptyState } from '@/components/ui/empty-state'; import { Badge } from '@/components/ui/badge'; import { Pagination } from '@/components/ui/pagination'; import { listGenes } from '@/lib/queries/genomics'; import { fmtInt } from '@/lib/format'; import { str, int, bool, withParams, type SP } from '@/lib/search-params'; export const metadata: Metadata = { title: 'Genes', description: 'HGNC genes with curated cancer evidence, variants and cohort frequencies.' }; // Filtered list: rendered per request (searchParams); 600 s is the CDN/ISR hint shared by all list pages. export const revalidate = 600; const PAGE_SIZE = 50; export default async function GenesPage({ searchParams }: { searchParams: Promise }) { const sp = await searchParams; const q = str(sp, 'q'); const cancerOnly = bool(sp, 'cancer') ?? false; const page = int(sp, 'page', 1, 1, 100_000); const { rows, total } = await listGenes({ q, cancerOnly, page, pageSize: PAGE_SIZE }); const href = (o: Record) => `/genes${withParams({ q, cancer: cancerOnly ? '1' : '' }, o)}`; return (

{fmtInt(total)} genes

{rows.length === 0 ? (
{total === 0 && !q ? 'The HGNC connector has not run on this environment. Genes appear here once ingested, with CIViC evidence and GDC cohort frequencies attached.' : 'Try a different symbol or alias.'}
) : ( <>
{rows.map((g) => ( ))}
Symbol Name Location Locus type Evidence items Variants Flags
{g.symbol} {g.name ?? '—'} {g.location ?? '—'} {g.locus_type ?? '—'} {fmtInt(g.evidence_count ?? 0)} {fmtInt(g.variant_count ?? 0)} {g.is_cancer_gene ? Cancer gene : null}
href({ page: p === 1 ? '' : p })} /> )}
); }