@@ -12,7 +12,7 @@ const OperatorPerformanceContainer = styled.div`
1212 border-radius: 16px;
1313 flex-direction: column;
1414 padding: 32px 20px 46px 32px;
15- background-color: ${ props => props . theme . colors . white } ;
15+ background-color: ${ ( props ) => props . theme . colors . white } ;
1616 @media (max-width: 576px) {
1717 width: 100%;
1818 },
@@ -27,7 +27,7 @@ const DataHeader = styled.div`
2727 font-style: normal;
2828 margin-bottom: auto;
2929 font-stretch: normal;
30- color: ${ props => props . theme . colors . gray40 } ;
30+ color: ${ ( props ) => props . theme . colors . gray40 } ;
3131` ;
3232
3333const ValueContent = styled . div `
@@ -37,43 +37,58 @@ const ValueContent = styled.div`
3737 font-style: normal;
3838 font-stretch: normal;
3939 letter-spacing: -0.5px;
40- color: ${ props => props . theme . colors . gray100 } ;
40+ color: ${ ( props ) => props . theme . colors . gray100 } ;
4141` ;
4242
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 ;
4759
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' :
5072 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' ;
6376 }
77+ statusText = ! status ? < Skeleton style = { { width : 100 } } /> : status ;
78+ }
6479
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+ ) ;
7792} ;
7893
7994export default observer ( OperatorStatus ) ;
0 commit comments