Add missing prop validation, cleanup
This commit is contained in:
1 parent
cb0ec0e182
commit
b2095670ff
6 files changed
+34
-5
No files matched your search
@@ -6,12 +6,15 @@ import SkeletonLayout from "./skeleton";
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
import useUtils from "../../../Home/Hooks/useUtils";
|
||||
import { getHumanReadableDuration } from "../../../../../Utils/timeUtils";
|
||||
|
||||
import PropTypes from "prop-types";
|
||||
const StatusBoxes = ({ shouldRender, monitor, certificateExpiry }) => {
|
||||
// Utils
|
||||
const theme = useTheme();
|
||||
const { determineState } = useUtils();
|
||||
|
||||
if (!shouldRender) {
|
||||
return <SkeletonLayout />;
|
||||
}
|
||||
const theme = useTheme();
|
||||
const { time: streakTime, units: streakUnits } = getHumanReadableDuration(
|
||||
monitor?.uptimeStreak
|
||||
);
|
||||
@@ -20,8 +23,6 @@ const StatusBoxes = ({ shouldRender, monitor, certificateExpiry }) => {
|
||||
monitor?.timeSinceLastCheck
|
||||
);
|
||||
|
||||
const { determineState } = useUtils();
|
||||
|
||||
return (
|
||||
<Stack
|
||||
direction="row"
|
||||
@@ -73,4 +74,10 @@ const StatusBoxes = ({ shouldRender, monitor, certificateExpiry }) => {
|
||||
);
|
||||
};
|
||||
|
||||
StatusBoxes.propTypes = {
|
||||
shouldRender: PropTypes.bool,
|
||||
monitor: PropTypes.object,
|
||||
certificateExpiry: PropTypes.string,
|
||||
};
|
||||
|
||||
export default StatusBoxes;
|
||||
Reference in new issue
Block a user