@@ -9,7 +9,7 @@ import { useOrganization, type MatchedOrganization } from "~/hooks/useOrganizati
99import { useProject } from "~/hooks/useProject" ;
1010import { cn } from "~/utils/cn" ;
1111import { branchesPath , docsPath , v3BillingPath } from "~/utils/pathBuilder" ;
12- import { EnvironmentCombo } from "../environments/EnvironmentLabel" ;
12+ import { EnvironmentCombo , EnvironmentIcon , environmentFullTitle } from "../environments/EnvironmentLabel" ;
1313import { ButtonContent } from "../primitives/Buttons" ;
1414import { Header2 } from "../primitives/Headers" ;
1515import { Paragraph } from "../primitives/Paragraph" ;
@@ -22,6 +22,7 @@ import {
2222 PopoverTrigger ,
2323} from "../primitives/Popover" ;
2424import { TextLink } from "../primitives/TextLink" ;
25+ import { SimpleTooltip } from "../primitives/Tooltip" ;
2526import { V4Badge } from "../V4Badge" ;
2627import { type SideMenuEnvironment , type SideMenuProject } from "./SideMenu" ;
2728import { Badge } from "../primitives/Badge" ;
@@ -31,11 +32,13 @@ export function EnvironmentSelector({
3132 project,
3233 environment,
3334 className,
35+ isCollapsed = false ,
3436} : {
3537 organization : MatchedOrganization ;
3638 project : SideMenuProject ;
3739 environment : SideMenuEnvironment ;
3840 className ?: string ;
41+ isCollapsed ?: boolean ;
3942} ) {
4043 const { isManagedCloud } = useFeatures ( ) ;
4144 const [ isMenuOpen , setIsMenuOpen ] = useState ( false ) ;
@@ -48,6 +51,20 @@ export function EnvironmentSelector({
4851
4952 const hasStaging = project . environments . some ( ( env ) => env . type === "STAGING" ) ;
5053
54+ if ( isCollapsed ) {
55+ return (
56+ < SimpleTooltip
57+ button = {
58+ < div className = "flex h-8 w-full items-center justify-center rounded transition-colors hover:bg-charcoal-750" >
59+ < EnvironmentIcon environment = { environment } className = "size-5" />
60+ </ div >
61+ }
62+ content = { environmentFullTitle ( environment ) }
63+ side = "right"
64+ />
65+ ) ;
66+ }
67+
5168 return (
5269 < Popover onOpenChange = { ( open ) => setIsMenuOpen ( open ) } open = { isMenuOpen } >
5370 < PopoverArrowTrigger
0 commit comments