File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed
web/packages/shared/components/UnifiedResources Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ import {
35
35
import { PinButton } from '../shared/PinButton' ;
36
36
import { ResourceActionButtonWrapper } from '../shared/ResourceActionButton' ;
37
37
import { SingleLineBox } from '../shared/SingleLineBox' ;
38
+ import { isUnhealthy } from '../shared/StatusInfo' ;
38
39
import { ResourceItemProps } from '../types' ;
39
40
import { WarningRightEdgeBadgeSvg } from './WarningRightEdgeBadgeSvg' ;
40
41
@@ -167,7 +168,7 @@ export function ResourceCard({
167
168
}
168
169
} ;
169
170
170
- const hasUnhealthyStatus = status && status !== 'healthy' ;
171
+ const hasUnhealthyStatus = isUnhealthy ( status ) ;
171
172
172
173
return (
173
174
< CardContainer
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ import {
35
35
} from '../shared/getBackgroundColor' ;
36
36
import { PinButton } from '../shared/PinButton' ;
37
37
import { ResourceActionButtonWrapper } from '../shared/ResourceActionButton' ;
38
+ import { isUnhealthy } from '../shared/StatusInfo' ;
38
39
import { ResourceItemProps } from '../types' ;
39
40
40
41
export function ResourceListItem ( {
@@ -70,7 +71,7 @@ export function ResourceListItem({
70
71
} , [ expandAllLabels ] ) ;
71
72
72
73
const showLabelsButton = labels . length > 0 && ( hovered || showLabels ) ;
73
- const hasUnhealthyStatus = status && status !== 'healthy' ;
74
+ const hasUnhealthyStatus = isUnhealthy ( status ) ;
74
75
75
76
// Determines which column the resource type text should end at.
76
77
// We do this because if there is no address, or the labels button
Original file line number Diff line number Diff line change @@ -39,7 +39,11 @@ import { useInfiniteScroll } from 'shared/hooks';
39
39
import { Attempt } from 'shared/hooks/useAttemptNext' ;
40
40
import { pluralize } from 'shared/utils/text' ;
41
41
42
- import { SharedResourceServer , UnifiedResourceDefinition } from '../types' ;
42
+ import {
43
+ ResourceStatus ,
44
+ SharedResourceServer ,
45
+ UnifiedResourceDefinition ,
46
+ } from '../types' ;
43
47
import { SingleLineBox } from './SingleLineBox' ;
44
48
import { getDatabaseIconName } from './viewItemsFactory' ;
45
49
@@ -311,3 +315,7 @@ export function openStatusInfoPanel({
311
315
} ) ;
312
316
}
313
317
}
318
+
319
+ export function isUnhealthy ( status : ResourceStatus ) : boolean {
320
+ return status && status === 'unhealthy' ;
321
+ }
You can’t perform that action at this time.
0 commit comments