Files
MOPC-Portal/src/components/layouts/applicant-nav.tsx

39 lines
1.2 KiB
TypeScript
Raw Normal View History

'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 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: 'Resources', href: '/applicant/resources', icon: BookOpen },
]
return (
<RoleNav
navigation={navigation}
roleName="Applicant"
user={user}
basePath="/applicant"
/>
)
}