'use client'; import { useSearchParams } from 'next/navigation'; import { useEffect } from 'react'; /** * Legacy `?tab=` deep links (evidence drawer "View history" → `?tab=history&property=`) land on the matching section of the * section-nav layout. Maps old tab ids to section anchors; does nothing when the parameter is absent. */ const MAP: Record = { history: 'change-history', benchmarks: 'benchmarks', providers: 'providers-pricing', hardware: 'hardware-fit', lineage: 'lineage', capabilities: 'capabilities', research: 'papers', timeline: 'timeline', sources: 'provenance' }; export function ScrollToSection() { const sp = useSearchParams(); const tab = sp.get('tab'); useEffect(() => { if (!tab) return; const id = MAP[tab] ?? tab; const el = document.getElementById(id); if (el) el.scrollIntoView({ block: 'start' }); }, [tab]); return null; }