import { Collection, CustomizationSettings, Space } from '@gitbook/api'; import { CustomizationHeaderPreset } from '@gitbook/api'; import { Suspense } from 'react'; import { CONTAINER_STYLE, HEADER_HEIGHT_DESKTOP } from '@/components/layout'; import { t, getSpaceLanguage } from '@/intl/server'; import { ContentRefContext } from '@/lib/references'; import { tcls } from '@/lib/tailwind'; import { CollectionSpacesDropdown } from './CollectionSpacesDropdown'; import { HeaderLink } from './HeaderLink'; import { HeaderLinks } from './HeaderLinks'; import { HeaderLogo } from './HeaderLogo'; import { SearchButton } from '../Search'; /** * Render the header for the space. */ export function Header(props: { space: Space; collection: Collection | null; collectionSpaces: Space[]; context: ContentRefContext; customization: CustomizationSettings; withTopHeader?: boolean; }) { const { context, space, collection, collectionSpaces, customization, withTopHeader } = props; const isCustomizationDefault = customization.header.preset === CustomizationHeaderPreset.Default; return (
{collection ? ( ) : null} {customization.header.links.map((link, index) => { return ( ); })}
span]:text-header-link/7', '[&_svg]:stroke-header-link', 'dark:bg-header-link-600/3', 'dark:ring-header-link-600/2', 'dark:text-header-link/7', 'dark:[&_svg]:stroke-header-link/7', ] : null } > {t( getSpaceLanguage(customization), customization.aiSearch.enabled ? 'search_or_ask' : 'search', )}
); }