@@ -12,7 +12,7 @@ const OperatorPerformanceContainer = styled.div`
12
12
border-radius: 16px;
13
13
flex-direction: column;
14
14
padding: 32px 20px 46px 32px;
15
- background-color: ${ props => props . theme . colors . white } ;
15
+ background-color: ${ ( props ) => props . theme . colors . white } ;
16
16
@media (max-width: 576px) {
17
17
width: 100%;
18
18
},
@@ -27,7 +27,7 @@ const DataHeader = styled.div`
27
27
font-style: normal;
28
28
margin-bottom: auto;
29
29
font-stretch: normal;
30
- color: ${ props => props . theme . colors . gray40 } ;
30
+ color: ${ ( props ) => props . theme . colors . gray40 } ;
31
31
` ;
32
32
33
33
const ValueContent = styled . div `
@@ -37,43 +37,58 @@ const ValueContent = styled.div`
37
37
font-style: normal;
38
38
font-stretch: normal;
39
39
letter-spacing: -0.5px;
40
- color: ${ props => props . theme . colors . gray100 } ;
40
+ color: ${ ( props ) => props . theme . colors . gray100 } ;
41
41
` ;
42
42
43
- const OperatorStatus = ( { status, is_deleted } : { status : string , is_deleted ?: boolean } ) => {
44
- const headerTooltipStyle = { fontSize : '14px' , color : 'rgb(161, 172, 190)' , marginBottom : '-2px' } ;
45
- let textColor : string ;
46
- let statusText : JSX . Element | string ;
43
+ const OperatorStatus = ( {
44
+ status,
45
+ is_deleted,
46
+ is_valid,
47
+ } : {
48
+ status : string ;
49
+ is_deleted ?: boolean ;
50
+ is_valid ?: boolean ;
51
+ } ) => {
52
+ const headerTooltipStyle = {
53
+ fontSize : '14px' ,
54
+ color : 'rgb(161, 172, 190)' ,
55
+ marginBottom : '-2px' ,
56
+ } ;
57
+ let textColor : string ;
58
+ let statusText : JSX . Element | string ;
47
59
48
- if ( is_deleted ) {
49
- statusText = 'Deleted' ;
60
+ if ( is_deleted ) {
61
+ statusText = 'Deleted' ;
62
+ textColor = '#ec1c26' ;
63
+ } else if ( ! is_valid ) {
64
+ statusText = 'Invalid' ;
65
+ textColor = '#ec1c26' ;
66
+ } else {
67
+ switch ( status ) {
68
+ case 'Active' :
69
+ textColor = '#08c858' ;
70
+ break ;
71
+ case 'Inactive' :
50
72
textColor = '#ec1c26' ;
51
- } else {
52
- switch ( status ) {
53
- case 'Active' :
54
- textColor = '#08c858' ;
55
- break ;
56
- case 'Inactive' :
57
- textColor = '#ec1c26' ;
58
- break ;
59
- default :
60
- textColor = '#808080' ;
61
- }
62
- statusText = ! status ? < Skeleton style = { { width : 100 } } /> : status ;
73
+ break ;
74
+ default :
75
+ textColor = '#808080' ;
63
76
}
77
+ statusText = ! status ? < Skeleton style = { { width : 100 } } /> : status ;
78
+ }
64
79
65
- return (
66
- < OperatorPerformanceContainer >
67
- < DataHeader >
68
- Status
69
- < InfoTooltip
70
- style = { headerTooltipStyle }
71
- message = "Is the operator performing duties for the majority of its validators in the last 2 epochs."
72
- />
73
- </ DataHeader >
74
- < ValueContent style = { { color : textColor } } > { statusText } </ ValueContent >
75
- </ OperatorPerformanceContainer >
76
- ) ;
80
+ return (
81
+ < OperatorPerformanceContainer >
82
+ < DataHeader >
83
+ Status
84
+ < InfoTooltip
85
+ style = { headerTooltipStyle }
86
+ message = "Is the operator performing duties for the majority of its validators in the last 2 epochs."
87
+ />
88
+ </ DataHeader >
89
+ < ValueContent style = { { color : textColor } } > { statusText } </ ValueContent >
90
+ </ OperatorPerformanceContainer >
91
+ ) ;
77
92
} ;
78
93
79
94
export default observer ( OperatorStatus ) ;
0 commit comments