feat: wire AWARD_MASTER into auth redirects and role-switch navigation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -162,6 +162,7 @@ const ROLE_SWITCH_OPTIONS: Record<string, { label: string; path: string; icon: t
|
||||
JURY_MEMBER: { label: 'Jury View', path: '/jury', icon: Scale },
|
||||
MENTOR: { label: 'Mentor View', path: '/mentor', icon: Handshake },
|
||||
OBSERVER: { label: 'Observer View', path: '/observer', icon: Eye },
|
||||
AWARD_MASTER: { label: 'Award Master', path: '/award-master', icon: Trophy },
|
||||
}
|
||||
|
||||
export function AdminSidebar({ user }: AdminSidebarProps) {
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
import type { Route } from 'next'
|
||||
import type { LucideIcon } from 'lucide-react'
|
||||
import {
|
||||
LogOut, Menu, Moon, Settings, Sun, User, X,
|
||||
LogOut, Menu, Moon, Settings, Sun, User, X, Trophy,
|
||||
LayoutDashboard, Scale, Handshake, Eye, ArrowRightLeft,
|
||||
ExternalLink as ExternalLinkIcon, HelpCircle, Mail,
|
||||
} from 'lucide-react'
|
||||
@@ -61,6 +61,7 @@ const ROLE_SWITCH_OPTIONS: Record<string, { label: string; path: string; icon: t
|
||||
JURY_MEMBER: { label: 'Jury View', path: '/jury', icon: Scale },
|
||||
MENTOR: { label: 'Mentor View', path: '/mentor', icon: Handshake },
|
||||
OBSERVER: { label: 'Observer View', path: '/observer', icon: Eye },
|
||||
AWARD_MASTER: { label: 'Award Master', path: '/award-master', icon: Trophy },
|
||||
}
|
||||
|
||||
function isNavItemActive(pathname: string, href: string, basePath: string): boolean {
|
||||
|
||||
@@ -10,6 +10,7 @@ const ROLE_DASHBOARDS: Record<string, string> = {
|
||||
MENTOR: '/mentor',
|
||||
OBSERVER: '/observer',
|
||||
APPLICANT: '/applicant',
|
||||
AWARD_MASTER: '/award-master',
|
||||
}
|
||||
|
||||
export async function requireRole(...allowedRoles: UserRole[]) {
|
||||
|
||||
Reference in New Issue
Block a user