import { ReactNode, useMemo } from 'react' import { Outlet, useLocation } from '@remix-run/react' import { MDXProvider } from '@mdx-js/react' import { PencilSimple } from 'phosphor-react' import { Header } from '../components/Header/Header' import { Heading, HeadingProps } from '~/components/Text/Heading' import { Copy, CopyProps } from '~/components/Text/Copy' import { List, ListProps } from '~/components/Text/List' import { Anchor, AnchorProps } from '~/components/Text/Anchor' import { H } from '~/components/Code/H' import { MenuDocs } from '~/components/Menu/MenuDocs' import { MenuSticky } from '~/components/Menu/MenuSticky' import { StickyAside } from '~/components/Asides/StickyAside' import { Code } from '~/components/Code/Code' import { LivePreviewStyles } from '~/components/Code/LivePreviewStyles' import { Callout } from '~/components/Callout' import { Feedback } from '~/components/Feedback/Feedback' import { flattenNavigationWithChildren, getNavigations, } from '~/helpers/navigation' import { getDocFilePathToGithub } from '~/helpers/links' import { useIsDarkTheme } from '~/hooks/useIsDarkTheme' import { WidgetCarbon } from '~/components/Widgets/WidgetCarbon' import { h1, h2, h3, h4, h5, list, p, article, blockQuote, editAnchor, footer, grid, main, mainStickyMenu, } from '../styles/routes/docs.css' const comps = { h1: (props: HeadingProps) => ( ), h2: (props: HeadingProps) => { return }, h3: (props: HeadingProps) => ( ), h4: (props: HeadingProps) => ( ), h5: (props: HeadingProps) => ( ), h6: () => null, p: (props: CopyProps) => , ul: (props: ListProps) => , ol: (props: ListProps) => , a: (props: AnchorProps) => , blockquote: (props: any) =>
, pre: (props: { children: string showLineNumbers?: string id?: string line?: string live?: string code: string copy?: string defaultOpen?: string showCode?: string template?: keyof LivePreviewStyles }) => { const { defaultOpen, children, code, showLineNumbers, id, line, live, copy, showCode, template, } = props return ( {children} ) }, H, warning: (props: { children?: ReactNode }) => ( ), note: (props: { children?: ReactNode }) => ( ), } export default function DocsLayout() { const location = useLocation() const navigation = getNavigations(location.pathname) const isDarkMode = useIsDarkTheme() const hasStickySubnav = navigation.subnav && navigation.subnav.length > 0 const flatRoutes = useMemo( () => flattenNavigationWithChildren(navigation.sidebar), [navigation.sidebar] ) const activeRoute = flatRoutes.find(item => item.href === location.pathname) return ( <>
{hasStickySubnav ? ( ) : null}
{/* @ts-expect-error */}
) }