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%
581 B · 12 lines tsx
Raw Blame History
1'use client';2import { useRouter } from 'next/navigation';3import type { GraphExploreMode } from '@/lib/types';4import { defaultModeFor, graphHref } from './modes';5import { NodeSearch as Search } from './node-search';67/** Standalone root picker that navigates to `/graph?node=` (empty / not-found states of the graph pages). */8export function NodeSearch({ mode, depth }: { mode?: GraphExploreMode; depth?: 1 | 2 }) {9  const router = useRouter();10  return <Search autoFocus onPick={(s) => router.push(graphHref(s.slug, mode ?? defaultModeFor(s.entity_type), depth ?? 1))} />;11}12