@@ -11,34 +11,26 @@ const StyledAlert = styled(Alert)(({ theme }) => ({
11
11
marginInline : `var(--popover-inline-padding, ${ theme . spacing ( 4 ) } )` ,
12
12
} ) ) ;
13
13
14
- const DisabledInfo = ( { feature } : { feature : PlaygroundFeatureSchema } ) => {
15
- const resolveHintText = ( feature : PlaygroundFeatureSchema ) => {
16
- if (
17
- feature . hasUnsatisfiedDependency &&
18
- ! feature . isEnabledInCurrentEnvironment
19
- ) {
20
- return 'If the environment was enabled and parent dependencies were satisfied' ;
21
- }
22
- if ( feature . hasUnsatisfiedDependency ) {
23
- return 'If parent dependencies were satisfied' ;
24
- }
25
- if ( ! feature . isEnabledInCurrentEnvironment ) {
26
- return 'If the environment was enabled' ;
27
- }
28
- return '' ;
29
- } ;
30
-
31
- const text = resolveHintText ( feature ) ;
14
+ const DisabledEnvInfo = ( { feature } : { feature : PlaygroundFeatureSchema } ) => {
15
+ const text =
16
+ feature . hasUnsatisfiedDependency &&
17
+ ! feature . isEnabledInCurrentEnvironment
18
+ ? 'If the environment was enabled and parent dependencies were satisfied'
19
+ : feature . hasUnsatisfiedDependency
20
+ ? 'If parent dependencies were satisfied'
21
+ : ! feature . isEnabledInCurrentEnvironment
22
+ ? 'If the environment was enabled'
23
+ : '' ;
32
24
33
25
if ( ! text ) {
34
26
return null ;
35
27
}
36
28
37
29
return (
38
30
< StyledAlert severity = { 'info' } color = { 'info' } >
39
- { resolveHintText ( feature ) } , then this feature flag would be{ ' ' }
31
+ { text } , then this feature flag would be{ ' ' }
40
32
{ feature . strategies ?. result ? 'TRUE' : 'FALSE' } with strategies
41
- evaluated like this:{ ' ' }
33
+ evaluated like this:
42
34
</ StyledAlert >
43
35
) ;
44
36
} ;
@@ -67,7 +59,7 @@ export const PlaygroundResultFeatureStrategyList = ({
67
59
68
60
return (
69
61
< >
70
- < DisabledInfo feature = { feature } />
62
+ < DisabledEnvInfo feature = { feature } />
71
63
< PlaygroundResultStrategyLists
72
64
strategies = { enabledStrategies || [ ] }
73
65
input = { input }
0 commit comments