remove box container and move fallback outisde wrapper

This commit is contained in:
Vishnu Sreekumaran Nair committed 2025-02-18 13:53:02 -05:00
1 parent e5246e82cc
commit 96378a5581
1 file changed
+43 -56
+43 -56
View File
@@ -42,66 +42,53 @@ const Maintenance = () => {
fetchMaintenanceWindows(); fetchMaintenanceWindows();
}, [page, rowsPerPage, updateTrigger]); }, [page, rowsPerPage, updateTrigger]);
if (maintenanceWindows.length === 0) {
return (
<Fallback
title="maintenance window"
checks={[
"Mark your maintenance periods",
"Eliminate any misunderstandings",
"Stop sending alerts in maintenance windows",
]}
link="/maintenance/create"
isAdmin={isAdmin}
/>
);
}
return ( return (
<Box
className="maintenance table-container" <Stack gap={theme.spacing(8)}>
sx={{ <Stack
':has(> [class*="fallback__"])': { direction="row"
position: "relative", justifyContent="space-between"
border: 1, alignItems="center"
borderColor: theme.palette.primary.lowContrast, mt={theme.spacing(5)}
borderRadius: theme.shape.borderRadius, >
borderStyle: "dashed", <Breadcrumbs list={[{ name: "maintenance", path: "/maintenance" }]} />
backgroundColor: theme.palette.primary.main, <Button
overflow: "hidden", variant="contained"
}, color="accent"
}} onClick={() => {
> navigate("/maintenance/create");
{maintenanceWindows.length > 0 && ( }}
<Stack gap={theme.spacing(8)}> sx={{ fontWeight: 500 }}
<Stack
direction="row"
justifyContent="space-between"
alignItems="center"
mt={theme.spacing(5)}
> >
<Breadcrumbs list={[{ name: "maintenance", path: "/maintenance" }]} /> Create maintenance window
<Button </Button>
variant="contained"
color="accent"
onClick={() => {
navigate("/maintenance/create");
}}
sx={{ fontWeight: 500 }}
>
Create maintenance window
</Button>
</Stack>
<MaintenanceTable
page={page}
setPage={setPage}
rowsPerPage={rowsPerPage}
sort={sort}
setSort={setSort}
maintenanceWindows={maintenanceWindows}
maintenanceWindowCount={maintenanceWindowCount}
updateCallback={handleActionMenuDelete}
/>
</Stack> </Stack>
)} <MaintenanceTable
{maintenanceWindows.length === 0 && ( page={page}
<Fallback setPage={setPage}
title="maintenance window" rowsPerPage={rowsPerPage}
checks={[ sort={sort}
"Mark your maintenance periods", setSort={setSort}
"Eliminate any misunderstandings", maintenanceWindows={maintenanceWindows}
"Stop sending alerts in maintenance windows", maintenanceWindowCount={maintenanceWindowCount}
]} updateCallback={handleActionMenuDelete}
link="/maintenance/create"
isAdmin={isAdmin}
/> />
)} </Stack>
</Box>
); );
}; };