11import type { GitBookSiteContext } from '@/lib/context' ;
2- import { Suspense } from 'react' ;
32
43import { CONTAINER_STYLE , HEADER_HEIGHT_DESKTOP } from '@/components/layout' ;
54import { getSpaceLanguage , t } from '@/intl/server' ;
65import { tcls } from '@/lib/tailwind' ;
7-
8- import { CustomizationAIMode } from '@gitbook/api' ;
9- import { AIChatButton } from '../AIChat/AIChatButton' ;
10- import { SearchButton } from '../Search' ;
116import { SiteSectionTabs , encodeClientSiteSections } from '../SiteSections' ;
127import { HeaderLink } from './HeaderLink' ;
138import { HeaderLinkMore } from './HeaderLinkMore' ;
@@ -22,9 +17,9 @@ import { SpacesDropdown } from './SpacesDropdown';
2217export function Header ( props : {
2318 context : GitBookSiteContext ;
2419 withTopHeader ?: boolean ;
25- withAIChat ?: boolean ;
20+ search ?: React . ReactNode ;
2621} ) {
27- const { context, withTopHeader, withAIChat } = props ;
22+ const { context, withTopHeader, search } = props ;
2823 const { siteSpace, siteSpaces, sections, customization } = context ;
2924
3025 return (
@@ -123,54 +118,7 @@ export function Header(props: {
123118 : [ 'order-last' ]
124119 ) }
125120 >
126- < Suspense fallback = { null } >
127- < SearchButton
128- style = { [
129- 'theme-bold:bg-header-link/2' ,
130- 'theme-bold:hover:bg-header-link/3' ,
131-
132- 'theme-bold:text-header-link/8' ,
133- 'theme-bold:hover:text-header-link' ,
134-
135- 'theme-bold:ring-header-link/4' ,
136- 'theme-bold:hover:ring-header-link/5' ,
137-
138- 'theme-bold:[&_svg]:text-header-link/10' ,
139- 'theme-bold:[&_.shortcut]:text-header-link/8' ,
140-
141- 'theme-bold:contrast-more:bg-header-background' ,
142- 'theme-bold:contrast-more:text-header-link' ,
143- 'theme-bold:contrast-more:ring-header-link' ,
144- 'theme-bold:contrast-more:hover:bg-header-background' ,
145- 'theme-bold:contrast-more:hover:ring-header-link' ,
146- 'theme-bold:contrast-more:focus:text-header-link' ,
147- 'theme-bold:contrast-more:focus:bg-header-background' ,
148- 'theme-bold:contrast-more:focus:ring-header-link' ,
149-
150- 'theme-bold:shadow-none' ,
151- 'theme-bold:hover:shadow-none' ,
152- 'whitespace-nowrap' ,
153- ] }
154- >
155- < span className = { tcls ( 'flex-1' ) } >
156- { t (
157- getSpaceLanguage ( customization ) ,
158- // TODO: remove aiSearch and optional chain once the cache has been fully updated (after 11/07/2025)
159- customization . aiSearch ?. enabled ||
160- customization . ai ?. mode !==
161- CustomizationAIMode . None
162- ? 'search_or_ask'
163- : 'search'
164- ) }
165- ...
166- </ span >
167- </ SearchButton >
168- </ Suspense >
169- { withAIChat && (
170- < AIChatButton
171- trademark = { context . customization . trademark . enabled }
172- />
173- ) }
121+ { search }
174122 </ div >
175123
176124 { customization . header . links . length > 0 && (
0 commit comments