Made changes as requested in PR.

This commit is contained in:
Owaise Imdad
2025-05-19 23:21:00 +05:30
parent cf344b1809
commit 6ba52156b8
3 changed files with 9 additions and 3 deletions

View File

@@ -13,6 +13,7 @@ import { useNavigate } from "react-router-dom";
import { useTheme } from "@mui/material/styles";
import { usePauseMonitor } from "../../Hooks/useMonitorControls";
import { useSendTestEmail } from "../../Hooks/useSendTestEmail";
import { useTranslation } from "react-i18next";
/**
* MonitorDetailsControlHeader component displays the control header for monitor details.
@@ -36,6 +37,7 @@ const MonitorDetailsControlHeader = ({
}) => {
const navigate = useNavigate();
const theme = useTheme();
const { t } = useTranslation();
const [pauseMonitor, isPausing, error] = usePauseMonitor({
monitorId: monitor?._id,
triggerUpdate,
@@ -60,12 +62,12 @@ const MonitorDetailsControlHeader = ({
>
<Button
variant="contained"
color="accent"
color="secondary"
loading={isSending}
startIcon={<EmailIcon />}
onClick={sendTestEmail}
>
Test e-mail
{t("sendTestEmail")}
</Button>
<Button
variant="contained"

View File

@@ -22,6 +22,9 @@ const useSendTestEmail = () => {
throw new Error("Failed to send test email");
}
} catch (error) {
createToast({
body: "Failed to send test email",
});
setError(error);
} finally {
setIsSending(false);

View File

@@ -536,5 +536,6 @@
"passwordRequirements": "New password must contain at least 8 characters and must have at least one uppercase letter, one lowercase letter, one number and one special character.",
"saving": "Saving..."
},
"uptimeCreateSelectURL": "Enter the URL or IP to monitor (e.g., https://example.com/ or 192.168.1.100) and add a clear display name that appears on the dashboard."
"uptimeCreateSelectURL": "Enter the URL or IP to monitor (e.g., https://example.com/ or 192.168.1.100) and add a clear display name that appears on the dashboard.",
"sendTestEmail": "Send test email"
}