Files
Checkmate/client/src/Pages/Incidents/Components/StatusBoxes/index.jsx
T

44 lines
975 B
React
Raw Normal View History

2025-07-01 15:54:50 +05:30
import PropTypes from "prop-types";
import { Stack } from "@mui/material";
import StatusBox from "./StatusBox";
import { useTheme } from "@emotion/react";
import SkeletonLayout from "./skeleton";
2025-07-01 18:10:35 +05:30
const StatusBoxes = ({ isLoading, summary }) => {
2025-07-01 15:54:50 +05:30
const theme = useTheme();
2025-07-01 17:55:50 +05:30
if (isLoading) return <SkeletonLayout shouldRender={isLoading} />;
2025-07-01 15:54:50 +05:30
return (
<Stack
gap={theme.spacing(12)}
direction="row"
justifyContent="space-between"
>
<StatusBox
title={"Total Incidents"}
2025-07-01 18:10:35 +05:30
value={summary?.totalChecks || 0}
2025-07-01 15:54:50 +05:30
/>
<StatusBox
title={"Resolved"}
status="up"
2025-07-01 18:10:35 +05:30
value={summary?.resolvedChecks || 0}
/>
<StatusBox
title={"Cannot Resolve"}
status="paused"
value={summary?.cannotResolveChecks || 0}
/>
<StatusBox
title={"Down"}
status="down"
value={summary?.downChecks || 0}
2025-07-01 15:54:50 +05:30
/>
</Stack>
);
};
StatusBoxes.propTypes = {
2025-07-01 17:55:50 +05:30
isLoading: PropTypes.bool,
2025-07-01 18:10:35 +05:30
summary: PropTypes.object,
2025-07-01 15:54:50 +05:30
};
2025-07-01 18:10:35 +05:30
export default StatusBoxes;