import Link from 'next/link'; import { TaxNode } from '../lib/types'; interface Props { nodes: TaxNode[]; selected?: string; /** build the href for a node */ href: (id: string) => string; openAll?: boolean; /** node id -> conference slug -> count; renders conference tag chips */ breakdown?: Record>; chipHref?: (nodeId: string, conf: string) => string; confLabel?: Record; } function Chips({ id, p }: { id: string; p: Props }) { const b = p.breakdown?.[id]; if (!b || !p.chipHref) return null; return ( {Object.entries(b).sort((x, y) => y[1] - x[1]).map(([conf, n]) => ( {p.confLabel?.[conf] ?? conf} {n} ))} ); } export default function TaxonomyTree(props: Props) { const { nodes, selected = '', href, openAll = false } = props; return ( ); }