@@ -42,66 +42,52 @@ const Maintenance = () => {
42
42
fetchMaintenanceWindows ( ) ;
43
43
} , [ page , rowsPerPage , updateTrigger ] ) ;
44
44
45
+ if ( maintenanceWindows . length === 0 ) {
46
+ return (
47
+ < Fallback
48
+ title = "maintenance window"
49
+ checks = { [
50
+ "Mark your maintenance periods" ,
51
+ "Eliminate any misunderstandings" ,
52
+ "Stop sending alerts in maintenance windows" ,
53
+ ] }
54
+ link = "/maintenance/create"
55
+ isAdmin = { isAdmin }
56
+ />
57
+ ) ;
58
+ }
59
+
45
60
return (
46
- < Box
47
- className = "maintenance table-container"
48
- sx = { {
49
- ':has(> [class*="fallback__"])' : {
50
- position : "relative" ,
51
- border : 1 ,
52
- borderColor : theme . palette . primary . lowContrast ,
53
- borderRadius : theme . shape . borderRadius ,
54
- borderStyle : "dashed" ,
55
- backgroundColor : theme . palette . primary . main ,
56
- overflow : "hidden" ,
57
- } ,
58
- } }
59
- >
60
- { maintenanceWindows . length > 0 && (
61
- < Stack gap = { theme . spacing ( 8 ) } >
62
- < Stack
63
- direction = "row"
64
- justifyContent = "space-between"
65
- alignItems = "center"
66
- mt = { theme . spacing ( 5 ) }
67
- >
68
- < Breadcrumbs list = { [ { name : "maintenance" , path : "/maintenance" } ] } />
69
- < Button
70
- variant = "contained"
71
- color = "accent"
72
- onClick = { ( ) => {
73
- navigate ( "/maintenance/create" ) ;
74
- } }
75
- sx = { { fontWeight : 500 } }
76
- >
77
- Create maintenance window
78
- </ Button >
79
- </ Stack >
80
- < MaintenanceTable
81
- page = { page }
82
- setPage = { setPage }
83
- rowsPerPage = { rowsPerPage }
84
- sort = { sort }
85
- setSort = { setSort }
86
- maintenanceWindows = { maintenanceWindows }
87
- maintenanceWindowCount = { maintenanceWindowCount }
88
- updateCallback = { handleActionMenuDelete }
89
- />
90
- </ Stack >
91
- ) }
92
- { maintenanceWindows . length === 0 && (
93
- < Fallback
94
- title = "maintenance window"
95
- checks = { [
96
- "Mark your maintenance periods" ,
97
- "Eliminate any misunderstandings" ,
98
- "Stop sending alerts in maintenance windows" ,
99
- ] }
100
- link = "/maintenance/create"
101
- isAdmin = { isAdmin }
102
- />
103
- ) }
104
- </ Box >
61
+ < Stack gap = { theme . spacing ( 10 ) } >
62
+ < Stack
63
+ direction = "row"
64
+ justifyContent = "space-between"
65
+ alignItems = "center"
66
+ mt = { theme . spacing ( 5 ) }
67
+ >
68
+ < Breadcrumbs list = { [ { name : "maintenance" , path : "/maintenance" } ] } />
69
+ < Button
70
+ variant = "contained"
71
+ color = "accent"
72
+ onClick = { ( ) => {
73
+ navigate ( "/maintenance/create" ) ;
74
+ } }
75
+ sx = { { fontWeight : 500 } }
76
+ >
77
+ Create maintenance window
78
+ </ Button >
79
+ </ Stack >
80
+ < MaintenanceTable
81
+ page = { page }
82
+ setPage = { setPage }
83
+ rowsPerPage = { rowsPerPage }
84
+ sort = { sort }
85
+ setSort = { setSort }
86
+ maintenanceWindows = { maintenanceWindows }
87
+ maintenanceWindowCount = { maintenanceWindowCount }
88
+ updateCallback = { handleActionMenuDelete }
89
+ />
90
+ </ Stack >
105
91
) ;
106
92
} ;
107
93
0 commit comments