import Head from 'next/head' import { SidebarNav } from 'components/sidebar/SidebarNav' import { Header } from 'components/page-header/Header' import { SmallFooter } from 'components/page-footer/SmallFooter' import { ScrollButton } from 'components/ui/ScrollButton' import { SupportSection } from 'components/page-footer/SupportSection' import { DeprecationBanner } from 'components/page-header/DeprecationBanner' import { RestBanner } from 'components/page-header/RestBanner' import { useMainContext } from 'components/context/MainContext' import { useTranslation } from 'components/hooks/useTranslation' import { useRouter } from 'next/router' type Props = { children?: React.ReactNode } export const DefaultLayout = (props: Props) => { const { page, error, isHomepageVersion, currentPathWithoutLanguage, currentVersion, currentProduct, relativePath, fullUrl, status, } = useMainContext() const { t } = useTranslation(['errors', 'meta', 'scroll_button']) const router = useRouter() const metaDescription = page.introPlainText ? page.introPlainText : t('default_description') return (
{error === '404' ? ( {t('oops')} ) : (!isHomepageVersion && page.fullTitle) || (currentPathWithoutLanguage.includes('enterprise-server') && page.fullTitle) ? ( {page.fullTitle} ) : null} {/* For Google and Bots */} {page.hidden && } {page.languageVariants.map((languageVariant) => { return ( ) })} {/* For local site search indexing */} {page.topics.length > 0 && } {/* For analytics events */} {router.locale && } {currentVersion && } {currentProduct && } {relativePath && ( )} {page.type && } {page.documentType && } {status && } {/* OpenGraph data */} {page.fullTitle && ( <> )} Skip to main content {/* Need to set an explicit height for sticky elements since we also set overflow to auto */}
{props.children}
) }