import { Flex, globalCss, styled } from '@traefiklabs/faency' import { ReactNode, useMemo, useState } from 'react' import { Helmet } from 'react-helmet-async' import { useLocation } from 'react-router-dom' import Container from './Container' import { LAPTOP_BP, SideBarPanel, SideNav, TopNav } from './Navigation' import { ToastPool } from 'components/ToastPool' import { ToastProvider } from 'contexts/toasts' export const LIGHT_PRIMARY_COLOR = '#217F97' export const DARK_PRIMARY_COLOR = '#2AA2C1' export const globalStyles = globalCss({ '.light': { '--colors-primary': LIGHT_PRIMARY_COLOR, }, '.dark': { '--colors-primary': DARK_PRIMARY_COLOR, }, body: { backgroundColor: '$contentBg', m: 0, }, }) const PageContainer = styled(Container, { py: '$5', px: '$5', m: 0, '@media (max-width:1440px)': { maxWidth: '100%', }, }) export interface Props { title?: string children?: ReactNode } const Page = ({ children }: Props) => { const { pathname } = useLocation() const [isSideBarPanelOpen, setIsSideBarPanelOpen] = useState(false) const location = useLocation() const isDemoPage = useMemo(() => pathname.includes('hub-dashboard'), [pathname]) const renderedContent = useMemo(() => { if (isDemoPage) { return children } return ( {children} ) }, [children, isDemoPage, location.pathname]) return ( {globalStyles()} Traefik Proxy setIsSideBarPanelOpen(true)} isResponsive /> {renderedContent} ) } export default Page