mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 21:47:20 +00:00
relates to #9831 Implements the mdm mac OS scripts UI. This is just the UI atm and is not accessible in the application at the moment.
52 lines
1.2 KiB
TypeScript
52 lines
1.2 KiB
TypeScript
import React from "react";
|
|
|
|
import Modal from "components/Modal";
|
|
import Button from "components/buttons/Button";
|
|
|
|
const baseClass = "delete-script-modal";
|
|
|
|
interface IDeleteScriptModalProps {
|
|
scriptName: string;
|
|
scriptId: number;
|
|
onCancel: () => void;
|
|
onDelete: (scriptId: number) => void;
|
|
}
|
|
|
|
const DeleteScriptModal = ({
|
|
scriptName,
|
|
scriptId,
|
|
onCancel,
|
|
onDelete,
|
|
}: IDeleteScriptModalProps) => {
|
|
return (
|
|
<Modal
|
|
className={baseClass}
|
|
title={"Delete script"}
|
|
onExit={onCancel}
|
|
onEnter={() => onDelete(scriptId)}
|
|
>
|
|
<>
|
|
<p>
|
|
This action will cancel script{" "}
|
|
<span className={`${baseClass}__script-name`}>{scriptName}</span> from
|
|
running on macOS hosts on which the scrupt hasn't run yet.
|
|
</p>
|
|
<div className="modal-cta-wrap">
|
|
<Button
|
|
type="button"
|
|
onClick={() => onDelete(scriptId)}
|
|
variant="alert"
|
|
className="delete-loading"
|
|
>
|
|
Delete
|
|
</Button>
|
|
<Button onClick={onCancel} variant="inverse-alert">
|
|
Cancel
|
|
</Button>
|
|
</div>
|
|
</>
|
|
</Modal>
|
|
);
|
|
};
|
|
|
|
export default DeleteScriptModal;
|