diff --git a/client/src/Components/MonitorDetailsControlHeader/index.jsx b/client/src/Components/MonitorDetailsControlHeader/index.jsx
index 1d253e3d5..9a76af551 100644
--- a/client/src/Components/MonitorDetailsControlHeader/index.jsx
+++ b/client/src/Components/MonitorDetailsControlHeader/index.jsx
@@ -2,6 +2,7 @@ import Stack from "@mui/material/Stack";
import Status from "./status";
import Skeleton from "./skeleton";
import Button from "@mui/material/Button";
+import { Tooltip } from "@mui/material";
import SettingsOutlinedIcon from "@mui/icons-material/SettingsOutlined";
import PauseOutlinedIcon from "@mui/icons-material/PauseOutlined";
import PlayArrowOutlinedIcon from "@mui/icons-material/PlayArrowOutlined";
@@ -40,6 +41,8 @@ const MonitorDetailsControlHeader = ({
const { t } = useTranslation();
const [pauseMonitor, isPausing, error] = usePauseMonitor();
+ const isTestNotificationsDisabled = monitor?.notifications?.length === 0;
+
// const [isSending, emailError, sendTestEmail] = useSendTestEmail();
const [testAllNotifications, isSending, errorAllNotifications] =
@@ -60,20 +63,52 @@ const MonitorDetailsControlHeader = ({
direction="row"
gap={theme.spacing(2)}
>
- }
- onClick={() => {
- testAllNotifications({ monitorId: monitor?._id });
- }}
- sx={{
- whiteSpace: "nowrap",
- }}
+
- {t("sendTestNotifications")}
-
+ {isTestNotificationsDisabled ? (
+
+ }
+ disabled
+ onClick={() => {
+ testAllNotifications({ monitorId: monitor?._id });
+ }}
+ sx={{
+ whiteSpace: "nowrap",
+ }}
+ >
+ {t("sendTestNotifications")}
+
+
+ ) : (
+ }
+ onClick={() => {
+ testAllNotifications({ monitorId: monitor?._id });
+ }}
+ sx={{
+ whiteSpace: "nowrap",
+ }}
+ >
+ {t("sendTestNotifications")}
+
+ )}
+