standardize uptime directory structure, use shared components

This commit is contained in:
Alex Holliday committed 2025-01-28 11:03:46 -08:00
1 parent ac669d8fe1
commit 9840999183
5 files changed
+28 -11

No files matched your search

@@ -30,7 +30,7 @@ const StatusBoxes = ({ shouldRender, monitorsSummary }) => {
};
StatusBoxes.propTypes = {
monitorsSummary: PropTypes.object.isRequired,
monitorsSummary: PropTypes.object,
};
export default StatusBoxes;
@@ -12,7 +12,9 @@ import { useState } from "react";
import SearchComponent from "../SearchComponent";
import CircularCount from "../../../../../Components/CircularCount";
import LoadingSpinner from "../LoadingSpinner";
import MonitorCountHeader from "../../../../../Components/MonitorCountHeader";
import UptimeDataTableSkeleton from "./skeleton";
// Utils
import { useTheme } from "@emotion/react";
import useUtils from "../../Hooks/useUtils";
@@ -214,21 +216,19 @@ const UptimeDataTable = (props) => {
flex={1}
py={theme.spacing(8)}
>
<Stack
direction="row"
alignItems="center"
mb={theme.spacing(8)}
gap={theme.spacing(2)}
<MonitorCountHeader
shouldRender={!monitorsAreLoading}
monitorCount={monitorCount}
heading="Uptime monitors"
sx={{ mb: theme.spacing(8) }}
>
<Heading component="h2">Uptime monitors</Heading>
<CircularCount count={monitorCount} />
<SearchComponent
monitorsAreLoading={monitorsAreLoading}
monitors={monitors}
onSearchChange={setSearch}
setIsSearching={setIsSearching}
/>
</Stack>
</MonitorCountHeader>
<MonitorDataTable
shouldRender={!monitorsAreLoading}
+19 -2
View File
@@ -4,7 +4,8 @@ import Greeting from "../../../Utils/greeting";
import StatusBoxes from "./Components/StatusBoxes";
import UptimeDataTable from "./Components/UptimeDataTable";
import Pagination from "../../../Components/Table/TablePagination";
import CreateMonitorHeader from "../../../Components/CreateMonitorHeader";
import Fallback from "../../../Components/Fallback";
// MUI Components
import { Stack, Box, Button } from "@mui/material";
@@ -99,13 +100,29 @@ const UptimeMonitors = () => {
});
const totalMonitors = monitorsSummary?.totalMonitors ?? 0;
if (!isLoading && monitors?.length === 0) {
return (
<Fallback
vowelStart={true}
title="uptime monitor"
checks={["Check if a website or service is up and running"]}
link="/uptime/create"
isAdmin={isAdmin}
/>
);
}
return (
<Stack
className="monitors"
gap={theme.spacing(10)}
>
<Breadcrumbs list={BREADCRUMBS} />
<CreateMonitorButton shouldRender={true} />
<CreateMonitorHeader
isAdmin={isAdmin}
shouldRender={!isLoading}
path="/uptime/create"
/>
<Greeting type="uptime" />
<StatusBoxes
monitorsSummary={monitorsSummary}