import { Box, Flex, Spacer, useDisclosure } from '@chakra-ui/react'; import type { TOC } from '@site/types/Docs'; import type { ReactNode } from 'react'; import { Toc } from '../Toc'; import { LEFT_SIDEBAR_WIDTH, MAX_CONTENT_WIDTH, TOP_NAVBAR_HEIGHT, } from './constants'; import { Footer } from './Footer'; import type { LeftSidebarProps } from './LeftSidebar'; import { LeftSidebar } from './LeftSidebar'; import { LeftSidebarDrawer } from './LeftSidebarDrawer'; import { LocalNavbar } from './LocalNavbar'; import { RightSidebar } from './RightSidebar'; import { TopNavbar } from './TopNavbar'; export type LayoutProps = { children: ReactNode; hideLeftSideBar?: boolean; leftSidebarProps?: Omit; toc?: TOC; }; export const Layout = ({ hideLeftSideBar, toc, children, leftSidebarProps, }: LayoutProps) => { const { isOpen, onOpen, onClose } = useDisclosure(); return ( <> {!hideLeftSideBar && leftSidebarProps && ( )} {!hideLeftSideBar && leftSidebarProps && ( )} {!hideLeftSideBar && !!leftSidebarProps && ( )} {children} {toc && ( )}