import { SideNav } from '@rkheftan/harmony-ui'; import { buildNavItems } from './buildNavItems'; import { appRoutes } from '@/routes/config'; import { Outlet, useLocation } from 'react-router-dom'; import { Box, useMediaQuery, useTheme } from '@mui/material'; import { Header } from './Header'; import { useState } from 'react'; import { Toolbar } from './Toolbar'; import { useApi } from '@/hooks/useApi'; import { fetchProfile } from '@/features/profile/api/settingsApi'; import type { User } from './type'; export const Layout = () => { const navItemConfigs = buildNavItems(appRoutes); const location = useLocation(); const theme = useTheme(); const isMobile = useMediaQuery(theme.breakpoints.down('md')); const [sideNavOpen, setSideNavOpen] = useState(false); const { data, loading } = useApi(fetchProfile, { immediate: true }); return ( setSideNavOpen(false)} header={ isMobile ? undefined : (
) } footer={ isMobile ? (
) : undefined } navConfig={navItemConfigs} activePath={location.pathname + location.hash} selectedVariant="textOnly" positioning="absolute" sideNavVariant={isMobile ? 'temporary' : 'full'} top={8.125} /> ); };