- Sign Out button during impersonation now returns to admin instead of destroying the session (fixes multi-click logout issue) - Applicant nav now respects learning_hub_external setting like jury/mentor - Track Learning Hub nav clicks via audit log (LEARNING_HUB_CLICK action) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
50 lines
1.6 KiB
TypeScript
50 lines
1.6 KiB
TypeScript
'use client'
|
|
|
|
import { Home, FolderOpen, FileText, MessageSquare, Trophy, Star, BookOpen } from 'lucide-react'
|
|
import { trpc } from '@/lib/trpc/client'
|
|
import { RoleNav, type NavItem, type RoleNavUser } from '@/components/layouts/role-nav'
|
|
|
|
interface ApplicantNavProps {
|
|
user: RoleNavUser
|
|
}
|
|
|
|
export function ApplicantNav({ user }: ApplicantNavProps) {
|
|
const { data: flags } = trpc.applicant.getNavFlags.useQuery(undefined, {
|
|
staleTime: 60_000,
|
|
})
|
|
const { data: featureFlags } = trpc.settings.getFeatureFlags.useQuery(undefined, {
|
|
staleTime: 60_000,
|
|
})
|
|
|
|
const useExternal = featureFlags?.learningHubExternal && featureFlags.learningHubExternalUrl
|
|
|
|
const navigation: NavItem[] = [
|
|
{ name: 'Dashboard', href: '/applicant', icon: Home },
|
|
{ name: 'Project', href: '/applicant/team', icon: FolderOpen },
|
|
{ name: 'Competition', href: '/applicant/competition', icon: Trophy },
|
|
{ name: 'Documents', href: '/applicant/documents', icon: FileText },
|
|
...(flags?.hasEvaluationRounds
|
|
? [{ name: 'Evaluations', href: '/applicant/evaluations', icon: Star }]
|
|
: []),
|
|
...(flags?.hasMentor
|
|
? [{ name: 'Mentoring', href: '/applicant/mentor', icon: MessageSquare }]
|
|
: []),
|
|
{
|
|
name: 'Learning Hub',
|
|
href: useExternal ? featureFlags.learningHubExternalUrl : '/applicant/resources',
|
|
icon: BookOpen,
|
|
external: !!useExternal,
|
|
},
|
|
]
|
|
|
|
return (
|
|
<RoleNav
|
|
navigation={navigation}
|
|
roleName="Applicant"
|
|
user={user}
|
|
basePath="/applicant"
|
|
helpEmail={featureFlags?.supportEmail || undefined}
|
|
/>
|
|
)
|
|
}
|