1- import type { RuntimeEnvironment } from "~/models/runtimeEnvironment.server" ;
2- import { cn } from "~/utils/cn" ;
3- import { sortEnvironments } from "~/utils/environmentSort" ;
4- import { SimpleTooltip } from "../primitives/Tooltip" ;
51import {
6- DeployedEnvironmentIcon ,
7- DevEnvironmentIcon ,
8- ProdEnvironmentIcon ,
2+ DeployedEnvironmentIconSmall ,
3+ DevEnvironmentIconSmall ,
4+ ProdEnvironmentIconSmall ,
95} from "~/assets/icons/EnvironmentIcons" ;
6+ import type { RuntimeEnvironment } from "~/models/runtimeEnvironment.server" ;
7+ import { cn } from "~/utils/cn" ;
108
119type Environment = Pick < RuntimeEnvironment , "type" > ;
1210
@@ -20,16 +18,20 @@ export function EnvironmentIcon({
2018 switch ( environment . type ) {
2119 case "DEVELOPMENT" :
2220 return (
23- < DevEnvironmentIcon className = { cn ( environmentTextClassName ( environment ) , className ) } />
21+ < DevEnvironmentIconSmall className = { cn ( environmentTextClassName ( environment ) , className ) } />
2422 ) ;
2523 case "PRODUCTION" :
2624 return (
27- < ProdEnvironmentIcon className = { cn ( environmentTextClassName ( environment ) , className ) } />
25+ < ProdEnvironmentIconSmall
26+ className = { cn ( environmentTextClassName ( environment ) , className ) }
27+ />
2828 ) ;
2929 case "STAGING" :
3030 case "PREVIEW" :
3131 return (
32- < DeployedEnvironmentIcon className = { cn ( environmentTextClassName ( environment ) , className ) } />
32+ < DeployedEnvironmentIconSmall
33+ className = { cn ( environmentTextClassName ( environment ) , className ) }
34+ />
3335 ) ;
3436 }
3537}
@@ -43,7 +45,7 @@ export function EnvironmentCombo({
4345} ) {
4446 return (
4547 < span className = { cn ( "flex items-center gap-1.5 text-sm text-text-bright" , className ) } >
46- < EnvironmentIcon environment = { environment } className = "size-4 " />
48+ < EnvironmentIcon environment = { environment } className = "size-[1.125rem] " />
4749 < EnvironmentLabel environment = { environment } />
4850 </ span >
4951 ) ;
@@ -89,54 +91,15 @@ export function environmentFullTitle(environment: Environment) {
8991 }
9092}
9193
92- export function environmentTypeTitle ( environment : Environment ) {
93- switch ( environment . type ) {
94- case "PRODUCTION" :
95- return "Prod" ;
96- case "STAGING" :
97- return "Staging" ;
98- case "DEVELOPMENT" :
99- return "Dev" ;
100- case "PREVIEW" :
101- return "Preview" ;
102- }
103- }
104-
105- export function environmentColorClassName ( environment : Environment ) {
106- switch ( environment . type ) {
107- case "PRODUCTION" :
108- return "bg-green-500" ;
109- case "STAGING" :
110- return "bg-amber-500" ;
111- case "DEVELOPMENT" :
112- return "bg-pink-500" ;
113- case "PREVIEW" :
114- return "bg-yellow-500" ;
115- }
116- }
117-
118- export function environmentBorderClassName ( environment : Environment ) {
119- switch ( environment . type ) {
120- case "PRODUCTION" :
121- return "border-green-500/50" ;
122- case "STAGING" :
123- return "border-amber-500/50" ;
124- case "DEVELOPMENT" :
125- return "border-pink-500/50" ;
126- case "PREVIEW" :
127- return "border-yellow-500/50" ;
128- }
129- }
130-
13194export function environmentTextClassName ( environment : Environment ) {
13295 switch ( environment . type ) {
13396 case "PRODUCTION" :
134- return "text-green-500 " ;
97+ return "text-prod " ;
13598 case "STAGING" :
136- return "text-amber-500 " ;
99+ return "text-staging " ;
137100 case "DEVELOPMENT" :
138- return "text-pink-500 " ;
101+ return "text-dev " ;
139102 case "PREVIEW" :
140- return "text-yellow-500 " ;
103+ return "text-preview " ;
141104 }
142105}
0 commit comments