11import { getRepos , getReposStats } from "@/actions" ;
22import { SourcebotLogo } from "@/app/components/sourcebotLogo" ;
33import { auth } from "@/auth" ;
4- import { Badge } from "@/components/ui/badge" ;
54import { Button } from "@/components/ui/button" ;
6- import { NavigationMenu as NavigationMenuBase , NavigationMenuItem , NavigationMenuLink , NavigationMenuList , navigationMenuTriggerStyle } from "@/components/ui/navigation-menu" ;
5+ import { NavigationMenu as NavigationMenuBase } from "@/components/ui/navigation-menu" ;
76import { Separator } from "@/components/ui/separator" ;
8- import { Tooltip , TooltipContent , TooltipTrigger } from "@/components/ui/tooltip" ;
97import { getSubscriptionInfo } from "@/ee/features/billing/actions" ;
108import { IS_BILLING_ENABLED } from "@/ee/features/billing/stripe" ;
119import { env } from "@/env.mjs" ;
1210import { ServiceErrorException } from "@/lib/serviceError" ;
13- import { cn , getShortenedNumberDisplayString , isServiceError } from "@/lib/utils" ;
11+ import { isServiceError } from "@/lib/utils" ;
1412import { DiscordLogoIcon , GitHubLogoIcon } from "@radix-ui/react-icons" ;
1513import { RepoJobStatus , RepoJobType } from "@sourcebot/db" ;
16- import { BookMarkedIcon , CircleIcon , MessageCircleIcon , SearchIcon , SettingsIcon } from "lucide-react" ;
1714import Link from "next/link" ;
1815import { redirect } from "next/navigation" ;
1916import { OrgSelector } from "../orgSelector" ;
2017import { SettingsDropdown } from "../settingsDropdown" ;
2118import WhatsNewIndicator from "../whatsNewIndicator" ;
19+ import { NavigationItems } from "./navigationItems" ;
2220import { ProgressIndicator } from "./progressIndicator" ;
2321import { TrialIndicator } from "./trialIndicator" ;
2422
@@ -70,7 +68,7 @@ export const NavigationMenu = async ({
7068
7169 return (
7270 < div className = "flex flex-col w-full h-fit bg-background" >
73- < div className = "flex flex-row justify-between items-center py-1 .5 px-3" >
71+ < div className = "flex flex-row justify-between items-center py-0 .5 px-3" >
7472 < div className = "flex flex-row items-center" >
7573 < Link
7674 href = { `/${ domain } ` }
@@ -92,61 +90,12 @@ export const NavigationMenu = async ({
9290 ) }
9391
9492 < NavigationMenuBase >
95- < NavigationMenuList className = "gap-2" >
96- < NavigationMenuItem >
97- < NavigationMenuLink
98- href = { `/${ domain } ` }
99- className = { cn ( navigationMenuTriggerStyle ( ) , "gap-2" ) }
100- >
101- < SearchIcon className = "w-4 h-4 mr-1" />
102- Search
103- </ NavigationMenuLink >
104- </ NavigationMenuItem >
105- < NavigationMenuItem >
106- < NavigationMenuLink
107- href = { `/${ domain } /chat` }
108- className = { navigationMenuTriggerStyle ( ) }
109- >
110- < MessageCircleIcon className = "w-4 h-4 mr-1" />
111- Ask
112- </ NavigationMenuLink >
113- </ NavigationMenuItem >
114- < NavigationMenuItem className = "relative" >
115- < Tooltip >
116- < TooltipTrigger asChild >
117- < NavigationMenuLink
118- href = { `/${ domain } /repos` }
119- className = { navigationMenuTriggerStyle ( ) }
120- >
121- < BookMarkedIcon className = "w-4 h-4 mr-1" />
122- < span className = "mr-2" > Repositories</ span >
123- < Badge variant = "secondary" className = "px-1.5 relative" >
124- { getShortenedNumberDisplayString ( numberOfRepos ) }
125- { numberOfReposWithFirstTimeIndexingJobsInProgress > 0 && (
126- < CircleIcon className = "absolute -right-0.5 -top-0.5 h-2 w-2 text-green-600" fill = "currentColor" />
127- ) }
128- </ Badge >
129- </ NavigationMenuLink >
130- </ TooltipTrigger >
131- < TooltipContent >
132- < p > { numberOfRepos } total { numberOfRepos === 1 ? 'repository' : 'repositories' } </ p >
133- </ TooltipContent >
134- </ Tooltip >
135- </ NavigationMenuItem >
136- { isAuthenticated && (
137- < >
138- < NavigationMenuItem >
139- < NavigationMenuLink
140- href = { `/${ domain } /settings` }
141- className = { navigationMenuTriggerStyle ( ) }
142- >
143- < SettingsIcon className = "w-4 h-4 mr-1" />
144- Settings
145- </ NavigationMenuLink >
146- </ NavigationMenuItem >
147- </ >
148- ) }
149- </ NavigationMenuList >
93+ < NavigationItems
94+ domain = { domain }
95+ numberOfRepos = { numberOfRepos }
96+ numberOfReposWithFirstTimeIndexingJobsInProgress = { numberOfReposWithFirstTimeIndexingJobsInProgress }
97+ isAuthenticated = { isAuthenticated }
98+ />
15099 </ NavigationMenuBase >
151100 </ div >
152101
0 commit comments