SPB Git forge

spb/ai-atlas

Public
41commits 1branches 0releases
4.6 MBsize
maindefault branch
12 days agolast push
HTML 77.2% TypeScript 10.5% Python 9.6% JavaScript 2.5%
906 B · 22 lines tsx
Raw Blame History
1'use client';2import { useSearchParams } from 'next/navigation';3import { useEffect } from 'react';45/**6 * Legacy `?tab=<id>` deep links (evidence drawer "View history" → `?tab=history&property=`) land on the matching section of the7 * section-nav layout. Maps old tab ids to section anchors; does nothing when the parameter is absent.8 */9const MAP: Record<string, string> = { history: 'change-history', benchmarks: 'benchmarks', providers: 'providers-pricing', hardware: 'hardware-fit', lineage: 'lineage', capabilities: 'capabilities', research: 'papers', timeline: 'timeline', sources: 'provenance' };1011export function ScrollToSection() {12  const sp = useSearchParams();13  const tab = sp.get('tab');14  useEffect(() => {15    if (!tab) return;16    const id = MAP[tab] ?? tab;17    const el = document.getElementById(id);18    if (el) el.scrollIntoView({ block: 'start' });19  }, [tab]);20  return null;21}22