From 1aedf21566281a8ac7f10614d31a02a9f6208cce Mon Sep 17 00:00:00 2001 From: Jesulayomy Date: Fri, 25 Jul 2025 13:37:17 -0400 Subject: [PATCH] [Uptime]: Added PropType validation, passed isClone directly as prop --- client/src/Pages/Uptime/Create/index.jsx | 10 +++++++--- client/src/Routes/index.jsx | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/client/src/Pages/Uptime/Create/index.jsx b/client/src/Pages/Uptime/Create/index.jsx index 9a847b251..e0cf7c372 100644 --- a/client/src/Pages/Uptime/Create/index.jsx +++ b/client/src/Pages/Uptime/Create/index.jsx @@ -22,6 +22,7 @@ import PulseDot from "../../../Components/Animated/PulseDot"; import SkeletonLayout from "./skeleton"; // Utils +import PropTypes from "prop-types"; import { useTheme } from "@emotion/react"; import { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; @@ -60,10 +61,9 @@ const parseUrl = (url) => { * Create page renders monitor creation or configuration views. * @component */ -const UptimeCreate = ({ clone }) => { +const UptimeCreate = ({ isClone = false }) => { const { monitorId } = useParams(); - const isCreate = typeof monitorId === "undefined" || clone === true; - const isClone = clone === true; + const isCreate = typeof monitorId === "undefined" || isClone; // States const [monitor, setMonitor] = useState({ @@ -720,4 +720,8 @@ const UptimeCreate = ({ clone }) => { ); }; +UptimeCreate.propTypes = { + isClone: PropTypes.bool, +}; + export default UptimeCreate; diff --git a/client/src/Routes/index.jsx b/client/src/Routes/index.jsx index 04d6f9b0b..350d2f82d 100644 --- a/client/src/Routes/index.jsx +++ b/client/src/Routes/index.jsx @@ -85,7 +85,7 @@ const Routes = () => { /> } + element={} />