import React from "react"; import { Routes, Route } from "react-router-dom"; import { useIsServer } from "../hooks"; import { Loading } from "../ui/atoms/loading"; import { MainContentContainer } from "../ui/atoms/page-content"; import { PageNotFound } from "../page-not-found"; import { MDN_PLUS_TITLE } from "../constants"; import { Settings } from "../settings"; import PlusDocs from "./plus-docs"; import { ArticleActionsContainer } from "../ui/organisms/article-actions-container"; import { DocParent } from "../../../libs/types/document"; import "./index.scss"; import OfferOverview from "./offer-overview"; const AiHelp = React.lazy(() => import("./ai-help")); const Collections = React.lazy(() => import("./collections")); const Updates = React.lazy(() => import("./updates")); interface LayoutProps { withoutContainer?: boolean; withSSR?: boolean; parents?: DocParent[]; children: React.ReactNode; } function Layout({ withoutContainer = false, withSSR = false, parents = undefined, children, }: LayoutProps) { const loading = ; const isServer = useIsServer(); const inner = ( <> {isServer ? ( withSSR ? ( children ) : ( loading ) ) : ( {children} )} ); return withoutContainer ? ( inner ) : ( <> {parents && } {inner} ); } export function Plus({ pageTitle, ...props }: { pageTitle?: string }) { React.useEffect(() => { document.title = pageTitle || MDN_PLUS_TITLE; }, [pageTitle]); return ( } /> } /> } /> } /> } /> } /> } /> ); }