File tree Expand file tree Collapse file tree 1 file changed +16
-15
lines changed
web/src/components/applications-page/application-list/delete-application-dialog Expand file tree Collapse file tree 1 file changed +16
-15
lines changed Original file line number Diff line number Diff line change 1
1
import { Application , selectById } from "~/modules/applications" ;
2
2
import {
3
+ Box ,
3
4
Button ,
4
5
CircularProgress ,
5
6
Dialog ,
@@ -87,6 +88,19 @@ export const DeleteApplicationDialog: FC<DeleteApplicationDialogProps> = memo(
87
88
dispatch ( clearDeletingApp ( ) ) ;
88
89
} , [ dispatch ] ) ;
89
90
91
+ const renderLabels = useCallback ( ( ) => {
92
+ if ( ! application ?. labelsMap ) return < Skeleton height = { 24 } width = { 200 } /> ;
93
+
94
+ if ( application . labelsMap . length === 0 ) return "-" ;
95
+
96
+ return application . labelsMap . map ( ( [ key , value ] ) => (
97
+ < Fragment key = { key } >
98
+ < span > { `${ key } : ${ value } ` } </ span >
99
+ < br />
100
+ </ Fragment >
101
+ ) ) ;
102
+ } , [ application ?. labelsMap ] ) ;
103
+
90
104
return (
91
105
< Dialog
92
106
open = { Boolean ( application ) }
@@ -109,23 +123,10 @@ export const DeleteApplicationDialog: FC<DeleteApplicationDialogProps> = memo(
109
123
< Skeleton height = { 24 } width = { 200 } />
110
124
) }
111
125
</ Typography >
112
- < div style = { { height : 24 } } /> { /* Spacer */ }
126
+ < Box height = { 24 } />
113
127
< Typography variant = "caption" > Labels</ Typography >
114
128
< Typography variant = "body1" className = { classes . applicationLabels } >
115
- { application ? (
116
- application . labelsMap . length !== 0 ? (
117
- application . labelsMap . map ( ( [ key , value ] ) => (
118
- < Fragment key = { key } >
119
- < span > { key + ": " + value } </ span >
120
- < br />
121
- </ Fragment >
122
- ) )
123
- ) : (
124
- "-"
125
- )
126
- ) : (
127
- < Skeleton height = { 24 } width = { 200 } />
128
- ) }
129
+ { renderLabels ( ) }
129
130
</ Typography >
130
131
</ DialogContent >
131
132
< DialogActions >
You can’t perform that action at this time.
0 commit comments