Email test button added in details page.
This commit is contained in:
1 parent
69bcd07c01
commit
cf344b1809
1 file changed
+13
@@ -5,12 +5,14 @@ import Button from "@mui/material/Button";
|
|||||||
import SettingsOutlinedIcon from "@mui/icons-material/SettingsOutlined";
|
import SettingsOutlinedIcon from "@mui/icons-material/SettingsOutlined";
|
||||||
import PauseOutlinedIcon from "@mui/icons-material/PauseOutlined";
|
import PauseOutlinedIcon from "@mui/icons-material/PauseOutlined";
|
||||||
import PlayArrowOutlinedIcon from "@mui/icons-material/PlayArrowOutlined";
|
import PlayArrowOutlinedIcon from "@mui/icons-material/PlayArrowOutlined";
|
||||||
|
import EmailIcon from '@mui/icons-material/Email';
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { useTheme } from "@mui/material/styles";
|
import { useTheme } from "@mui/material/styles";
|
||||||
import { usePauseMonitor } from "../../Hooks/useMonitorControls";
|
import { usePauseMonitor } from "../../Hooks/useMonitorControls";
|
||||||
|
import { useSendTestEmail } from "../../Hooks/useSendTestEmail";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MonitorDetailsControlHeader component displays the control header for monitor details.
|
* MonitorDetailsControlHeader component displays the control header for monitor details.
|
||||||
@@ -39,6 +41,8 @@ const MonitorDetailsControlHeader = ({
|
|||||||
triggerUpdate,
|
triggerUpdate,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const [isSending, emailError, sendTestEmail] = useSendTestEmail();
|
||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return <Skeleton />;
|
return <Skeleton />;
|
||||||
}
|
}
|
||||||
@@ -54,6 +58,15 @@ const MonitorDetailsControlHeader = ({
|
|||||||
direction="row"
|
direction="row"
|
||||||
gap={theme.spacing(2)}
|
gap={theme.spacing(2)}
|
||||||
>
|
>
|
||||||
|
<Button
|
||||||
|
variant="contained"
|
||||||
|
color="accent"
|
||||||
|
loading={isSending}
|
||||||
|
startIcon={<EmailIcon />}
|
||||||
|
onClick={sendTestEmail}
|
||||||
|
>
|
||||||
|
Test e-mail
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
|
|||||||
Reference in new issue
Block a user