import Link from 'next/link'; import { Section } from '@/components/ui/section'; import { EmptyState } from '@/components/ui/empty-state'; import { PathChainView } from '@/components/graph/path-chain'; import { defaultFocus, focusCancerIds, loadPaths, resolveFocus } from '@/lib/queries/graph'; import { fmtInt } from '@/lib/format'; /** * Home teaser for the knowledge graph: three strongest gene → variant → drug chains for the * most-connected cancer (chosen from the data at request time, never hardcoded) and a link to /graph. */ export async function GraphModule({ limit = 3 }: { limit?: number }) { const ref = await defaultFocus(); const focus = ref ? await resolveFocus(ref) : null; const chains = focus ? await loadPaths(focus, await focusCancerIds(focus), limit) : []; return (
Explore the graph → } > {!focus || chains.length === 0 ? ( No knowledge edge with a sensitivity direction is loaded yet, so no chain can be shown. ) : ( <>
    {chains.map((c) => ( ))}

{fmtInt(chains.length)} of the strongest chains for the cancer with the most knowledge edges ({focus.label}); ranked by source-native evidence level, then support. Not treatment guidance.

)}
); }