import { Link } from 'react-router'; import * as Dropdown from '@/components/ui/dropdown-menu'; import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'; import { User, LogOut, Settings, Puzzle, Bot, UserCog } from 'lucide-react'; import { useAuth } from 'hooks/useAuth'; import { useTranslation } from '@/lib/i18n'; const { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } = Dropdown; export function UserMenu() { const { user, isLoading } = useAuth(); const { t } = useTranslation(); if (isLoading) return null; return ( {t('header.userMenu.profile')} {t('header.userMenu.systemSettings')} {/* No Resources entry. `/settings/resources` has never been a route, so this item sent you to the catch-all and out to `/` — a menu entry that looks like navigation and is a bounce. (navigation-audit M8.) */} {t('header.userMenu.ai')} {t('header.userMenu.integrations')} {/* Owner only. This is tidiness, not access control — the route stays reachable and its endpoints are gated server-side by ownerGate, because a hidden menu item is not a permission and anything relying on it being hidden is already wrong. */} {user?.role === 'Super Admin' && ( {t('header.userMenu.userManagement')} )} {t('header.userMenu.signOut')} ); }