"use client"; import { NavigationMenuItem, NavigationMenuLink, NavigationMenuList, navigationMenuTriggerStyle } from "@/components/ui/navigation-menu"; import { Badge } from "@/components/ui/badge"; import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"; import { cn, getShortenedNumberDisplayString } from "@/lib/utils"; import { SearchIcon, MessageCircleIcon, BookMarkedIcon, SettingsIcon, CircleIcon } from "lucide-react"; import { usePathname } from "next/navigation"; interface NavigationItemsProps { domain: string; numberOfRepos: number; numberOfReposWithFirstTimeIndexingJobsInProgress: number; isAuthenticated: boolean; } export const NavigationItems = ({ domain, numberOfRepos, numberOfReposWithFirstTimeIndexingJobsInProgress, isAuthenticated, }: NavigationItemsProps) => { const pathname = usePathname(); const isActive = (href: string) => { if (href === `/${domain}`) { return pathname === `/${domain}`; } return pathname.startsWith(href); }; return ( Search {isActive(`/${domain}`) && } Ask {isActive(`/${domain}/chat`) && } Repositories {getShortenedNumberDisplayString(numberOfRepos)} {numberOfReposWithFirstTimeIndexingJobsInProgress > 0 && ( )} {isActive(`/${domain}/repos`) && } {isAuthenticated && ( Settings {isActive(`/${domain}/settings`) && } )} ); }; const ActiveIndicator = () => { return (
); };