@@ -82,8 +82,8 @@ const useCardState = ({
82
82
status ,
83
83
diff_panel ,
84
84
properties ,
85
- display_type
86
- )
85
+ display_type ,
86
+ ) ,
87
87
) ;
88
88
89
89
useDeepCompareEffect ( ( ) => {
@@ -93,11 +93,11 @@ const useCardState = ({
93
93
diff_panel ,
94
94
display_type ,
95
95
properties ,
96
- status
96
+ status ,
97
97
) ;
98
98
setCalculatedProperties ( newState ) ;
99
99
setCalculatedProperties (
100
- diff . buildCardState ( data , diff_panel , display_type , properties , status )
100
+ diff . buildCardState ( data , diff_panel , display_type , properties , status ) ,
101
101
) ;
102
102
} , [
103
103
data ,
@@ -164,7 +164,7 @@ const CardDiffDisplay: React.FC<{
164
164
className = { classNames (
165
165
"inline-flex rounded-lg px-2 font-medium md:mt-2 space-x-1 text-lg" ,
166
166
diff . status === "ok" ? "text-ok" : null ,
167
- diff . status === "alert" ? "text-alert" : null
167
+ diff . status === "alert" ? "text-alert" : null ,
168
168
// diff.status === "alert" ? "text-severity" : null
169
169
) }
170
170
>
@@ -194,15 +194,12 @@ const CardDiffDisplay: React.FC<{
194
194
} ;
195
195
196
196
const ValueWithDiff = ( { loading, value, diff } ) => (
197
- console . log ( "ValueWithDiff:" , { loading, value, diff } ) ,
198
- (
199
- < div className = "flex items-center space-x-2" >
200
- { " " }
201
- { /* Adjusts flex to align elements inline */ }
202
- < Value loading = { loading } value = { value } />
203
- { diff && < CardDiffDisplay diff = { diff } value = { value } /> }
204
- </ div >
205
- )
197
+ < div className = "flex items-center space-x-2" >
198
+ { " " }
199
+ { /* Adjusts flex to align elements inline */ }
200
+ < Value loading = { loading } value = { value } />
201
+ { diff && < CardDiffDisplay diff = { diff } value = { value } /> }
202
+ </ div >
206
203
) ;
207
204
208
205
const Card = ( props : CardProps ) => {
@@ -211,7 +208,7 @@ const Card = (props: CardProps) => {
211
208
const { searchPathPrefix } = useDashboard ( ) ;
212
209
const [ renderError , setRenderError ] = useState < string | null > ( null ) ;
213
210
const [ renderedHref , setRenderedHref ] = useState < string | null > (
214
- state . href || null
211
+ state . href || null ,
215
212
) ;
216
213
const { ready : templateRenderReady , renderTemplates } = useTemplateRender ( ) ;
217
214
@@ -240,7 +237,7 @@ const Card = (props: CardProps) => {
240
237
const doRender = async ( ) => {
241
238
const renderedResults = await renderTemplates (
242
239
{ card : state . href as string } ,
243
- [ renderData ]
240
+ [ renderData ] ,
244
241
) ;
245
242
if (
246
243
! renderedResults ||
@@ -252,7 +249,7 @@ const Card = (props: CardProps) => {
252
249
} else if ( renderedResults [ 0 ] . card . result ) {
253
250
const withSearchPathPrefix = injectSearchPathPrefix (
254
251
renderedResults [ 0 ] . card . result ,
255
- searchPathPrefix
252
+ searchPathPrefix ,
256
253
) ;
257
254
setRenderedHref ( withSearchPathPrefix ) ;
258
255
setRenderError ( null ) ;
@@ -269,7 +266,7 @@ const Card = (props: CardProps) => {
269
266
className = { classNames (
270
267
"overflow-hidden bg-dashboard-panel text-foreground print:bg-white print:text-black shadow-sm p-3 pr-5" ,
271
268
getWrapperClasses ( state . type ) ,
272
- ! state . icon ? "pl-4" : undefined
269
+ ! state . icon ? "pl-4" : undefined ,
273
270
) }
274
271
>
275
272
< div className = "flex space-x-3" >
0 commit comments