/* eslint-disable react/no-unstable-nested-components */ import React from 'react'; import { Box, HStack, Text, Link as GLink } from '../../primitives'; import { AppProviderWithOverlay } from '../../core'; import { LayoutContent } from './LayoutContent'; import { LayoutHeader } from './LayoutHeader'; import { LayoutSidebar } from './LayoutSidebar'; import { H1 } from '../H1'; import { H2 } from '../H2'; import { H3 } from '../H3'; import { H4 } from '../H4'; import { H5 } from '../H5'; import { UL } from '../UL'; import { LI } from '../LI'; import { BlockQuote } from '../BlockQuote'; import { InlineCode } from '../InlineCode'; import { LayoutContext } from './LayoutContext'; import ResponsiveSidebar from './ResponsiveSidebar'; import { CodePreview } from '../CodePreview'; import { PrevNextButtons } from '../PrevNextButtons'; import { ComponentIntro } from '../ComponentIntro'; import { HeadingTabs } from '../HeadingTabs'; import OL from '../OL'; import EditPageOnGithubLink from '../EditPageOnGithubLink'; import { showToc } from '../../utils/helperFunction'; function containsAny(targetString: string) { const stringsToCheck: string[] = [ 'gluestack.io', 'ui', 'style', 'enterprise', 'contact-us', ]; for (const str of stringsToCheck) { if (targetString.includes(str)) { return true; // The target string contains at least one of the strings to check. } } return false; // None of the strings were found in the target string. } export const Layout = React.forwardRef( ( { version, sidebarItems: sidebars, headerItems, // _footerItems, Link, router, children, MDXProvider, Image, colorMode, toggleColorMode, Provider, breadcrumbs, fluidLayout = false, Docsearch, }: any, docsLayoutRef: any ) => { const [isOpenSidebar, setIsOpenSidebar] = React.useState(false); let StyleProvider = AppProviderWithOverlay; if (Provider) { StyleProvider = Provider; } const [sidebarItems, setSidebarItems] = React.useState([]); const toc = showToc(sidebars, router.pathname); React.useEffect(() => { setSidebarItems(sidebars); }, [sidebars]); return ( { return

; }, h2: (props: any) => { return

; }, h3: (props: any) => { return

; }, h4: (props: any) => { return

; }, h5: (props: any) => { return

; }, pre: (props: any) => { return ( //@ts-ignore ); }, ul: (props: any) =>
    , ol: (props: any) =>
      , li: (props: any) => { return (
    1. {props?.children}
    2. ); }, p: (props: any) => ( ), a: (props: any) => { return ( ); }, code: (props: any) => { return {props.children}; }, blockquote: (props: any) => { //@ts-ignore x.children[1].props added due to internal bug in next-mdx return (
      {props.children[1].props.children}
      ); }, }} > {children} {/** Extra Space will be used for quick nav */} {toc ? ( ) : null} ); } );