'use client'; import { FC } from 'react'; import Link from 'next/link'; import clsx from 'clsx'; import { usePathname } from 'next/navigation'; import { useUser } from '@gitroom/frontend/components/layout/user.context'; import { useVariables } from '@gitroom/react/helpers/variable.context'; export const useMenuItems = () => { const {isGeneral} = useVariables(); return [ ...(!isGeneral ? [ { name: 'Analytics', icon: 'analytics', path: '/analytics', }, ] : []), { name: isGeneral ? 'Calendar' : 'Launches', icon: 'launches', path: '/launches', }, ...(isGeneral ? [ { name: 'Analytics', icon: 'analytics', path: '/analytics', }, ] : []), ...(!isGeneral ? [ { name: 'Settings', icon: 'settings', path: '/settings', role: ['ADMIN', 'SUPERADMIN'], }, ] : []), { name: 'Marketplace', icon: 'marketplace', path: '/marketplace', }, { name: 'Messages', icon: 'messages', path: '/messages', }, { name: 'Billing', icon: 'billing', path: '/billing', role: ['ADMIN', 'SUPERADMIN'], requireBilling: true, }, ]; } export const TopMenu: FC = () => { const path = usePathname(); const user = useUser(); const {billingEnabled} = useVariables(); const menuItems = useMenuItems(); return (