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/ScrollButton' import { SupportSection } from 'components/page-footer/SupportSection' import { DeprecationBanner } from 'components/page-header/DeprecationBanner' import { useMainContext } from 'components/context/MainContext' import { useTranslation } from './hooks/useTranslation' type Props = { children?: React.ReactNode } export const DefaultLayout = (props: Props) => { const { page, error, isHomepageVersion, currentPathWithoutLanguage, fullUrl } = useMainContext() const { t } = useTranslation('errors') return (
{error === '404' ? ( {t('oops')} ) : (!isHomepageVersion && page.fullTitle) || (currentPathWithoutLanguage.includes('enterprise-server') && page.fullTitle) ? ( {page.fullTitle} ) : null} {/* For Google and Bots */} {page.introPlainText && } {page.topics.length > 0 && } {page.hidden && } {page.languageVariants.map((languageVariant) => { return ( ) })} {page.fullTitle && ( <> )}
{props.children}
) }