File tree 1 file changed +20
-8
lines changed
1 file changed +20
-8
lines changed Original file line number Diff line number Diff line change 1
1
import type { TagProps } from '@nais/ds-svelte-community/components/Tag/type.js' ;
2
2
3
+ // HACK: mantained manually - should have been provided by Nais API
3
4
export const envTagVariant = ( env : string ) : TagProps [ 'variant' ] => {
4
- if ( env . includes ( 'prod' ) ) {
5
- if ( env . includes ( 'fss' ) ) {
5
+ switch ( env ) {
6
+ case 'non-prod' :
7
+ case 'sandbox' :
8
+ case 'dev-gcp' :
9
+ case 'ci' :
10
+ case 'test' :
11
+ case 'dev' :
12
+ return 'neutral-filled' ;
13
+ case 'prod-gcp' :
14
+ case 'prod' :
15
+ return 'info-moderate' ;
16
+ case 'prod-fss' :
6
17
return 'alt3-moderate' ;
7
- }
8
- return 'info-moderate' ;
18
+ case 'dev-fss' :
19
+ return 'neutral-moderate' ;
20
+ default :
21
+ if ( env . includes ( 'prod' ) ) {
22
+ return 'info-moderate' ;
23
+ }
24
+ return 'neutral-filled' ;
9
25
}
10
- if ( env . includes ( 'fss' ) ) {
11
- return 'neutral-moderate' ;
12
- }
13
- return 'neutral-filled' ;
14
26
} ;
You can’t perform that action at this time.
0 commit comments