spb/cancerindex
Public
TypeScript 97.2%
SQL 1.5%
CSS 0.6%
JavaScript 0.5%
1import Link from 'next/link';2import type { FocusType } from '@/lib/graph-model';34/**5 * "Explore in graph →" link for entity pages. `entityRef` is the public reference used by6 * `/graph?focus=`: cancer slug, gene symbol, variant slug, drug slug or NCT id. (Named `entityRef`7 * because `ref` is reserved by React and cannot be passed to a server component.)8 */9export function GraphLink({ type, entityRef, label = 'Explore in graph →', className = '' }: { type: FocusType; entityRef: string; label?: string; className?: string }) {10 return (11 <Link href={`/graph?focus=${type}:${encodeURIComponent(entityRef)}`} className={`ci-link inline-flex items-center gap-1 text-[13px]${className ? ` ${className}` : ''}`} title="Open the contextual knowledge graph around this entity">12 {label}13 </Link>14 );15}16