This commit is contained in:
john 2025-05-18 22:45:27 +02:00
parent 27098ec9fa
commit 4878897306
10 changed files with 268 additions and 32 deletions

View file

@ -1,9 +1,15 @@
import { PropsWithChildren } from 'react'
import { useUser } from '../app/user/userStore.ts'
import NavButton from './buttons/NavButton.tsx'
type NavBarProps = unknown
export default function NavBar({ children }: PropsWithChildren<NavBarProps>) {
const { user } = useUser()
return (
<nav className={`w-full flex flex-row justify-end gap-4 px-4 md:px-8 py-3`}>{children}</nav>
<nav className={`w-full flex flex-row justify-end gap-4 px-4 md:px-8 py-3`}>
{children}
{user?.isSuperUser && <NavButton to={'/admin/codes'}>admin</NavButton>}
</nav>
)
}