refactor: verplaats Manual en Admin naar user-menu dropdown
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
486736f267
commit
b55a929fd8
2 changed files with 15 additions and 3 deletions
|
|
@ -144,8 +144,6 @@ export function NavBar({
|
|||
{navLink('/insights', 'Insights', pathname.startsWith('/insights'))}
|
||||
{navLink('/ideas', 'Ideas', pathname.startsWith('/ideas'))}
|
||||
{navLink('/jobs', 'Jobs', pathname.startsWith('/jobs'))}
|
||||
{navLink('/manual', 'Manual', pathname.startsWith('/manual'))}
|
||||
{roles.includes('ADMIN') && navLink('/admin', 'Admin', pathname.startsWith('/admin'))}
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import { useTransition } from 'react'
|
||||
import Link from 'next/link'
|
||||
import { Settings, Sun, Globe, LogOut } from 'lucide-react'
|
||||
import { Settings, Sun, Globe, LogOut, BookOpen, Shield } from 'lucide-react'
|
||||
import { logoutAction } from '@/actions/auth'
|
||||
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
|
|
@ -112,6 +112,20 @@ export function UserMenu({ userId, username, email, roles }: UserMenuProps) {
|
|||
|
||||
<DropdownMenuSeparator />
|
||||
|
||||
<DropdownMenuItem render={<Link href="/manual" />}>
|
||||
<BookOpen className="mr-2 h-4 w-4" />
|
||||
<span>Manual</span>
|
||||
</DropdownMenuItem>
|
||||
|
||||
{roles.includes('ADMIN') && (
|
||||
<DropdownMenuItem render={<Link href="/admin" />}>
|
||||
<Shield className="mr-2 h-4 w-4" />
|
||||
<span>Admin</span>
|
||||
</DropdownMenuItem>
|
||||
)}
|
||||
|
||||
<DropdownMenuSeparator />
|
||||
|
||||
<DropdownMenuItem
|
||||
onClick={handleLogout}
|
||||
onSelect={handleLogout}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue