2022-09-01 15:28:02 +00:00
|
|
|
import React from "react";
|
2021-11-15 21:16:06 +00:00
|
|
|
import Modal from "components/Modal";
|
|
|
|
|
import Button from "components/buttons/Button";
|
2023-02-13 15:45:37 +00:00
|
|
|
import CustomLink from "components/CustomLink";
|
2021-11-15 21:16:06 +00:00
|
|
|
|
|
|
|
|
interface IDeleteSecretModal {
|
|
|
|
|
onDeleteSecret: () => void;
|
|
|
|
|
toggleDeleteSecretModal: () => void;
|
2022-08-29 15:21:37 +00:00
|
|
|
isUpdatingSecret: boolean;
|
2021-11-15 21:16:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const baseClass = "delete-secret-modal";
|
|
|
|
|
|
|
|
|
|
const DeleteSecretModal = ({
|
|
|
|
|
onDeleteSecret,
|
|
|
|
|
toggleDeleteSecretModal,
|
2022-08-29 15:21:37 +00:00
|
|
|
isUpdatingSecret,
|
2021-11-15 21:16:06 +00:00
|
|
|
}: IDeleteSecretModal): JSX.Element => {
|
|
|
|
|
return (
|
|
|
|
|
<Modal
|
|
|
|
|
onExit={toggleDeleteSecretModal}
|
2022-08-04 15:05:11 +00:00
|
|
|
onEnter={onDeleteSecret}
|
2024-02-23 14:57:18 +00:00
|
|
|
title="Delete secret"
|
2021-11-15 21:16:06 +00:00
|
|
|
className={baseClass}
|
|
|
|
|
>
|
|
|
|
|
<div className={baseClass}>
|
|
|
|
|
<div className={`${baseClass}__description`}>
|
2024-06-27 14:40:49 +00:00
|
|
|
<p>Hosts can no longer enroll using this secret.</p>
|
2021-11-15 21:16:06 +00:00
|
|
|
<p>
|
2023-02-13 15:45:37 +00:00
|
|
|
<CustomLink
|
2024-06-27 14:40:49 +00:00
|
|
|
url="https://fleetdm.com/learn-more-about/rotating-enroll-secrets"
|
|
|
|
|
text="Learn about rotating enroll secrets"
|
2023-02-13 15:45:37 +00:00
|
|
|
newTab
|
|
|
|
|
/>
|
|
|
|
|
</p>
|
2021-11-15 21:16:06 +00:00
|
|
|
</div>
|
2022-04-27 20:40:28 +00:00
|
|
|
<div className="modal-cta-wrap">
|
2021-11-15 21:16:06 +00:00
|
|
|
<Button
|
|
|
|
|
type="button"
|
|
|
|
|
variant="alert"
|
|
|
|
|
onClick={onDeleteSecret}
|
2022-08-29 15:21:37 +00:00
|
|
|
className="delete-loading"
|
|
|
|
|
isLoading={isUpdatingSecret}
|
2021-11-15 21:16:06 +00:00
|
|
|
>
|
|
|
|
|
Delete
|
|
|
|
|
</Button>
|
2022-08-29 15:21:37 +00:00
|
|
|
<Button onClick={toggleDeleteSecretModal} variant="inverse-alert">
|
|
|
|
|
Cancel
|
|
|
|
|
</Button>
|
2021-11-15 21:16:06 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</Modal>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default DeleteSecretModal;
|