fleet/frontend/pages/hosts/ManageHostsPage/components/DeleteHostModal/DeleteHostModal.tsx
Martavis Parker bcfac603f0
Added components to Storybook library (#2768)
* added storybook

* added avatar component

* added button story

* added dropdown button story

* removed unused ellipsis component

* cleaned up modal path

* reorganized enroll secrets table file

* added flash story; removed unused persistent flash

* added fleet ace story

* added checkbox story

* added dropdown story

* added input story

* fixed storybook build

* fixed avatar

* added input with icon story

* added radio button story

* added select targets dropdown story

* added slider story

* added tooltip story

* added info banner story

* removed unused loaders; added spinner story

* added modal story

* removed unused NumberPill

* added pagination story

* lint fixes

* added documentation to run

* modified documentation

* fixed corelayout test

* fixed format for date-fns

* fixed date format that breaks tests

* wait for page
2021-11-06 23:41:09 -07:00

60 lines
1.5 KiB
TypeScript

import React from "react";
import Modal from "components/Modal";
import Button from "components/buttons/Button";
const baseClass = "delete-host-modal";
interface IDeleteHostModalProps {
selectedHostIds: number[];
onSubmit: () => void;
onCancel: () => void;
isAllMatchingHostsSelected: boolean;
}
const DeleteHostModal = ({
selectedHostIds,
onSubmit,
onCancel,
isAllMatchingHostsSelected,
}: IDeleteHostModalProps): JSX.Element => {
return (
<Modal title={"Delete host"} onExit={onCancel} className={baseClass}>
<form className={`${baseClass}__form`}>
<p>
This action will delete{" "}
<b>
{selectedHostIds.length}
{isAllMatchingHostsSelected && "+"}{" "}
{selectedHostIds.length === 1 ? "host" : "hosts"}
</b>{" "}
from your Fleet instance.
</p>
<p>If the hosts come back online, they will automatically re-enroll.</p>
<p>
To prevent re-enrollment, you can disable or uninstall osquery on
these hosts.
</p>
<div className={`${baseClass}__btn-wrap`}>
<Button
className={`${baseClass}__btn`}
type="button"
onClick={onSubmit}
variant="alert"
>
Delete
</Button>
<Button
className={`${baseClass}__btn`}
onClick={onCancel}
variant="inverse-alert"
>
Cancel
</Button>
</div>
</form>
</Modal>
);
};
export default DeleteHostModal;