2022-02-24 14:15:50 +00:00
|
|
|
import React, { useEffect } from "react";
|
2021-07-26 18:41:36 +00:00
|
|
|
|
2021-11-07 06:41:09 +00:00
|
|
|
import Modal from "components/Modal";
|
2021-07-26 18:41:36 +00:00
|
|
|
import Button from "components/buttons/Button";
|
2022-05-17 19:14:09 +00:00
|
|
|
import Spinner from "components/Spinner";
|
2021-07-26 18:41:36 +00:00
|
|
|
|
|
|
|
const baseClass = "remove-scheduled-query-modal";
|
|
|
|
|
|
|
|
interface IRemoveScheduledQueryModalProps {
|
2022-08-29 15:21:37 +00:00
|
|
|
isUpdatingScheduledQuery: boolean;
|
2021-07-26 18:41:36 +00:00
|
|
|
onCancel: () => void;
|
|
|
|
onSubmit: () => void;
|
|
|
|
}
|
|
|
|
|
2021-10-22 15:34:45 +00:00
|
|
|
const RemoveScheduledQueryModal = ({
|
2022-08-29 15:21:37 +00:00
|
|
|
isUpdatingScheduledQuery,
|
2021-10-22 15:34:45 +00:00
|
|
|
onCancel,
|
|
|
|
onSubmit,
|
|
|
|
}: IRemoveScheduledQueryModalProps): JSX.Element => {
|
2021-07-26 18:41:36 +00:00
|
|
|
return (
|
|
|
|
<Modal
|
|
|
|
title={"Remove scheduled query"}
|
|
|
|
onExit={onCancel}
|
2022-08-04 15:05:11 +00:00
|
|
|
onEnter={onSubmit}
|
2021-07-26 18:41:36 +00:00
|
|
|
className={baseClass}
|
|
|
|
>
|
2022-08-29 15:21:37 +00:00
|
|
|
<div className={baseClass}>
|
|
|
|
Are you sure you want to remove the selected queries from the schedule?
|
|
|
|
<div className="modal-cta-wrap">
|
|
|
|
<Button
|
|
|
|
type="button"
|
|
|
|
variant="alert"
|
|
|
|
onClick={onSubmit}
|
|
|
|
className="remove-loading"
|
|
|
|
isLoading={isUpdatingScheduledQuery}
|
|
|
|
>
|
|
|
|
Remove
|
|
|
|
</Button>
|
|
|
|
<Button onClick={onCancel} variant="inverse-alert">
|
|
|
|
Cancel
|
|
|
|
</Button>
|
2021-07-26 18:41:36 +00:00
|
|
|
</div>
|
2022-08-29 15:21:37 +00:00
|
|
|
</div>
|
2021-07-26 18:41:36 +00:00
|
|
|
</Modal>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default RemoveScheduledQueryModal;
|