import Link from 'next/link'; import { Section } from '@/components/ui/section'; import { EmptyState } from '@/components/ui/empty-state'; import { Badge, MatchBadge } from '@/components/ui/badge'; import { JsonView } from '@/components/ui/json-view'; import { getContributingSources, getChangeEvents } from '@/lib/queries/cancers'; import { CODE_SYSTEM_LABEL, codeUrl } from '@/lib/site'; import { fmtDate, fmtDateTime, humanize } from '@/lib/format'; import type { CancerBundle } from '../load'; export async function SourcesTab({ b }: { b: CancerBundle }) { const [contrib, events] = await Promise.all([getContributingSources(b.cancer.id, b.descendants), getChangeEvents('cancer', b.cancer.id)]); return (
| Source | License | Contributions | Ingest runs | Last retrieved |
|---|---|---|---|---|
| {s.name} {' '} {s.slug} |
|
{s.kinds.map(humanize).join(', ')} | {s.run_ids.length ? ( s.run_ids.slice(0, 5).map((r) => ( {r} )) ) : ( — )} {s.run_ids.length > 5 ? +{s.run_ids.length - 5} more : null} | {s.last_retrieved ? fmtDateTime(s.last_retrieved) : '—'} |
| System | Code | Match type | Source |
|---|---|---|---|
| {CODE_SYSTEM_LABEL[k.system] ?? k.system} | {url ? ( {k.code} ) : ( {k.code} )} |
|
{k.source_slug ? ( {k.source_slug} ) : ( '—' )} |
| Alias | Type | Terminology | Language |
|---|---|---|---|
| {a.alias} |
|
{a.source_terminology ?? a.source_slug ?? '—'} | en |
Before
After