diff --git a/Client/src/Components/Dialog/index.jsx b/Client/src/Components/Dialog/index.jsx
index 97d822e84..3cf7001ce 100644
--- a/Client/src/Components/Dialog/index.jsx
+++ b/Client/src/Components/Dialog/index.jsx
@@ -1,18 +1,19 @@
import PropTypes from "prop-types";
-import LoadingButton from "@mui/lab/LoadingButton";
import { Button, Stack } from "@mui/material";
import { GenericDialog } from "./genericDialog";
+import { useTheme } from "@emotion/react";
const Dialog = ({
title,
description,
open,
- theme,
onCancel,
confirmationButtonLabel,
onConfirm,
isLoading,
}) => {
+ const theme = useTheme();
+
return (
Cancel
-
{confirmationButtonLabel}
-
+
);
@@ -51,7 +52,6 @@ Dialog.propTypes = {
title: PropTypes.string.isRequired,
description: PropTypes.string,
open: PropTypes.bool.isRequired,
- theme: PropTypes.object.isRequired,
onCancel: PropTypes.func.isRequired,
confirmationButtonLabel: PropTypes.string.isRequired,
onConfirm: PropTypes.func.isRequired,
diff --git a/Client/src/Pages/StatusPage/Status/Components/ControlsHeader/index.jsx b/Client/src/Pages/StatusPage/Status/Components/ControlsHeader/index.jsx
index ef8419069..11733fc61 100644
--- a/Client/src/Pages/StatusPage/Status/Components/ControlsHeader/index.jsx
+++ b/Client/src/Pages/StatusPage/Status/Components/ControlsHeader/index.jsx
@@ -9,7 +9,7 @@ import { useNavigate } from "react-router-dom";
import { useLocation } from "react-router-dom";
import PropTypes from "prop-types";
-const Controls = ({ deleteStatusPage, isDeleting }) => {
+const Controls = ({ isDeleteOpen, setIsDeleteOpen, isDeleting }) => {
const theme = useTheme();
const location = useLocation();
const currentPath = location.pathname;
@@ -17,7 +17,6 @@ const Controls = ({ deleteStatusPage, isDeleting }) => {
if (currentPath === "/status/public") {
return null;
}
-
return (
{
);
@@ -95,8 +96,9 @@ const ControlsHeader = ({ statusPage, deleteStatusPage, isDeleting }) => {
ControlsHeader.propTypes = {
statusPage: PropTypes.object,
- deleteStatusPage: PropTypes.func,
isDeleting: PropTypes.bool,
+ isDeleteOpen: PropTypes.bool.isRequired,
+ setIsDeleteOpen: PropTypes.func.isRequired,
};
export default ControlsHeader;
diff --git a/Client/src/Pages/StatusPage/Status/index.jsx b/Client/src/Pages/StatusPage/Status/index.jsx
index 7e392182e..e27bc8184 100644
--- a/Client/src/Pages/StatusPage/Status/index.jsx
+++ b/Client/src/Pages/StatusPage/Status/index.jsx
@@ -7,16 +7,19 @@ import ControlsHeader from "./Components/ControlsHeader";
import SkeletonLayout from "./Components/Skeleton";
import StatusBar from "./Components/StatusBar";
import MonitorsList from "./Components/MonitorsList";
+import Dialog from "../../../Components/Dialog";
+
// Utils
import { useStatusPageFetch } from "./Hooks/useStatusPageFetch";
import { useTheme } from "@emotion/react";
import { useIsAdmin } from "../../../Hooks/useIsAdmin";
import { useLocation } from "react-router-dom";
import { useStatusPageDelete } from "./Hooks/useStatusPageDelete";
+import { useState } from "react";
const PublicStatus = () => {
// Local state
-
+ const [isDeleteOpen, setIsDeleteOpen] = useState(false);
// Utils
const theme = useTheme();
const isAdmin = useIsAdmin();
@@ -123,17 +126,33 @@ const PublicStatus = () => {
Service status
{link}
+
);
};