update monitor details header
This commit is contained in:
1 parent
6f133ed7a0
commit
9bba8440ca
1 file changed
+7
-3
@@ -14,6 +14,7 @@ import { useTheme } from "@mui/material/styles";
|
|||||||
import { usePauseMonitor } from "../../Hooks/monitorHooks";
|
import { usePauseMonitor } from "../../Hooks/monitorHooks";
|
||||||
import { useSendTestEmail } from "../../Hooks/useSendTestEmail";
|
import { useSendTestEmail } from "../../Hooks/useSendTestEmail";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { useTestAllNotifications } from "../../Hooks/useNotifications";
|
||||||
/**
|
/**
|
||||||
* MonitorDetailsControlHeader component displays the control header for monitor details.
|
* MonitorDetailsControlHeader component displays the control header for monitor details.
|
||||||
* It includes status display, pause/resume button, and a configure button for admins.
|
* It includes status display, pause/resume button, and a configure button for admins.
|
||||||
@@ -39,7 +40,10 @@ const MonitorDetailsControlHeader = ({
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [pauseMonitor, isPausing, error] = usePauseMonitor();
|
const [pauseMonitor, isPausing, error] = usePauseMonitor();
|
||||||
|
|
||||||
const [isSending, emailError, sendTestEmail] = useSendTestEmail();
|
// const [isSending, emailError, sendTestEmail] = useSendTestEmail();
|
||||||
|
|
||||||
|
const [testAllNotifications, isSending, errorAllNotifications] =
|
||||||
|
useTestAllNotifications();
|
||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return <Skeleton />;
|
return <Skeleton />;
|
||||||
@@ -62,10 +66,10 @@ const MonitorDetailsControlHeader = ({
|
|||||||
loading={isSending}
|
loading={isSending}
|
||||||
startIcon={<EmailIcon />}
|
startIcon={<EmailIcon />}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
sendTestEmail();
|
testAllNotifications({ monitorId: monitor?._id });
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("sendTestEmail")}
|
{t("sendTestNotifications")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
|
|||||||
Reference in new issue
Block a user