2022-08-04 15:05:11 +00:00
|
|
|
import React from "react";
|
2021-08-03 20:09:01 +00:00
|
|
|
|
2021-11-07 06:41:09 +00:00
|
|
|
import Modal from "components/Modal";
|
2021-08-03 20:09:01 +00:00
|
|
|
import Button from "components/buttons/Button";
|
|
|
|
|
|
2022-08-04 15:05:11 +00:00
|
|
|
const baseClass = "delete-query-modal";
|
2021-08-03 20:09:01 +00:00
|
|
|
|
2022-08-04 15:05:11 +00:00
|
|
|
interface IDeleteQueryModalProps {
|
2022-08-29 15:21:37 +00:00
|
|
|
isUpdatingQueries: boolean;
|
2021-08-03 20:09:01 +00:00
|
|
|
onCancel: () => void;
|
|
|
|
|
onSubmit: () => void;
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-04 15:05:11 +00:00
|
|
|
const DeleteQueryModal = ({
|
2022-08-29 15:21:37 +00:00
|
|
|
isUpdatingQueries,
|
2021-10-22 15:34:45 +00:00
|
|
|
onCancel,
|
|
|
|
|
onSubmit,
|
2022-08-04 15:05:11 +00:00
|
|
|
}: IDeleteQueryModalProps): JSX.Element => {
|
2021-08-03 20:09:01 +00:00
|
|
|
return (
|
2022-08-04 15:05:11 +00:00
|
|
|
<Modal
|
2024-02-23 14:57:18 +00:00
|
|
|
title="Delete query"
|
2022-08-04 15:05:11 +00:00
|
|
|
onExit={onCancel}
|
|
|
|
|
onEnter={onSubmit}
|
|
|
|
|
className={baseClass}
|
|
|
|
|
>
|
2022-08-29 15:21:37 +00:00
|
|
|
<div className={baseClass}>
|
|
|
|
|
Are you sure you want to delete the selected queries?
|
|
|
|
|
<div className="modal-cta-wrap">
|
|
|
|
|
<Button
|
|
|
|
|
type="button"
|
|
|
|
|
variant="alert"
|
|
|
|
|
onClick={onSubmit}
|
|
|
|
|
className="delete-loading"
|
|
|
|
|
isLoading={isUpdatingQueries}
|
|
|
|
|
>
|
|
|
|
|
Delete
|
|
|
|
|
</Button>
|
|
|
|
|
<Button onClick={onCancel} variant="inverse-alert">
|
|
|
|
|
Cancel
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2021-08-03 20:09:01 +00:00
|
|
|
</Modal>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
2022-08-04 15:05:11 +00:00
|
|
|
export default DeleteQueryModal;
|