// js/_shared/SiteHeader.jsx // // Canonical site header. ONE component, every page. // Ported from beava-design-system/project/ui_kits/_shared/SiteHeader.jsx // with absolute paths so it works from any URL depth. // // Props: // active — 'guide' | 'docs' | 'community' | null // search — true to show ⌘K search bar in the middle (docs) // maxWidth — inner container width (1200 marketing, 1400 docs) // // Fallback index — used only when the Pagefind bundle fails to load // (e.g. file:// or before `npm run build:search` has been run). // The real index is generated by build-search.mjs into project/_pagefind/. const SEARCH_INDEX_FALLBACK = [ { title: 'Introduction', url: '/docs/', section: 'Getting started' }, { title: 'Install', url: '/docs/install/', section: 'Getting started' }, { title: 'Quickstart', url: '/docs/get-started/quickstart/', section: 'Getting started' }, { title: 'Define a pipeline', url: '/docs/get-started/define-a-pipeline/', section: 'Getting started' }, { title: 'Push events', url: '/docs/get-started/push-events/', section: 'Getting started' }, { title: 'Query features', url: '/docs/get-started/query-features/', section: 'Getting started' }, { title: 'Streams', url: '/docs/concepts/streams/', section: 'Concepts' }, { title: 'Tables', url: '/docs/concepts/tables/', section: 'Concepts' }, { title: 'Windows', url: '/docs/concepts/windows/', section: 'Concepts' }, { title: 'Operator catalog', url: '/docs/operators/', section: 'Reference' }, { title: 'Python SDK', url: '/docs/sdk-api/python/', section: 'Reference' }, { title: 'Why beava', url: '/docs/vision/why-beava/', section: 'Vision' }, { title: 'Benchmarks', url: '/docs/vision/benchmarks/', section: 'Vision' }, { title: 'Non-goals and tradeoffs', url: '/docs/vision/non-goals/', section: 'Vision' }, { title: 'Guide', url: '/guide/', section: 'Learn' }, { title: 'Chapter 1: Per-customer dashboard', url: '/guide/chapter-1/', section: 'Learn' }, ]; const SearchModal = ({ query, setQuery, onClose }) => { const [pagefind, setPagefind] = React.useState(null); const [pagefindFailed, setPagefindFailed] = React.useState(false); const [pagefindError, setPagefindError] = React.useState(''); const [results, setResults] = React.useState([]); React.useEffect(() => { // Babel-standalone wraps `