import Head from 'next/head' import { useRouter } from 'next/router' import { SidebarNav } from 'components/sidebar/SidebarNav' import { Header } from 'components/page-header/Header' import { LegalFooter } from 'components/page-footer/LegalFooter' import { ScrollButton } from 'components/ui/ScrollButton' import { SupportSection } from 'components/page-footer/SupportSection' import { DeprecationBanner } from 'src/versions/components/DeprecationBanner' import { RestBanner } from 'src/rest/components/RestBanner' import { useMainContext } from 'components/context/MainContext' import { useTranslation } from 'src/languages/components/useTranslation' import { Breadcrumbs } from 'components/page-header/Breadcrumbs' const MINIMAL_RENDER = Boolean(JSON.parse(process.env.MINIMAL_RENDER || 'false')) 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') // This is only true when we do search indexing which renders every page // just to be able to `cheerio` load the main body (and the meta // keywords tag). if (MINIMAL_RENDER) { return (