import { AppShell, Burger, Drawer, Flex, Footer, Group, NavLink, Navbar, Paper, Text, ThemeIcon, useMantineTheme, } from '@mantine/core'; import { useDisclosure } from '@mantine/hooks'; import { IconBook2, IconBrandDiscord, IconBrandGithub, IconGitFork, IconHome, IconLayoutDashboard, IconMailForward, IconQuestionMark, IconSettings2, IconUser, IconUsers, } from '@tabler/icons-react'; import { useSession } from 'next-auth/react'; import Image from 'next/image'; import Link from 'next/link'; import { ReactNode } from 'react'; import { useScreenLargerThan } from '~/hooks/useScreenLargerThan'; import { usePackageAttributesStore } from '~/tools/client/zustands/usePackageAttributesStore'; import { MainHeader } from '../header/Header'; interface ManageLayoutProps { children: ReactNode; } export const ManageLayout = ({ children }: ManageLayoutProps) => { const { attributes } = usePackageAttributesStore(); const theme = useMantineTheme(); const screenLargerThanMd = useScreenLargerThan('md'); const [burgerMenuOpen, { toggle: toggleBurgerMenu, close: closeBurgerMenu }] = useDisclosure(false); const data = useSession(); const isAdmin = data.data?.user.isAdmin ?? false; const navigationLinks = ( <> } label="Home" component={Link} href="/manage/" /> } component={Link} href="/manage/boards" /> {isAdmin && ( <> } > } label="Manage" component={Link} href="/manage/users" /> } label="Invites" component={Link} href="/manage/users/invites" /> } component={Link} href="/manage/settings" /> )} } > } component="a" href="https://homarr.dev/docs/about" label="Documentation" /> } component="a" href="https://github.com/ajnart/homarr/issues/new/choose" label="Report an issue / bug" /> } component="a" href="https://discord.com/invite/aCsmEV5RgA" label="Community Discord" /> } component="a" href="https://github.com/ajnart/homarr" label="Contribute" /> ); const burgerMenu = screenLargerThanMd ? undefined : ( ); return ( <> {navigationLinks} ); };