import React, { useEffect } from "react"; import Modal from "components/Modal"; import Button from "components/buttons/Button"; import { ITeam } from "interfaces/team"; interface IDeleteSecretModal { selectedTeam: number; teams: ITeam[]; onDeleteSecret: () => void; toggleDeleteSecretModal: () => void; } const baseClass = "delete-secret-modal"; const DeleteSecretModal = ({ selectedTeam, teams, onDeleteSecret, toggleDeleteSecretModal, }: IDeleteSecretModal): JSX.Element => { const renderTeam = () => { if (typeof selectedTeam === "string") { selectedTeam = parseInt(selectedTeam, 10); } if (selectedTeam === 0) { return { name: "No team" }; } return teams.find((team) => team.id === selectedTeam); }; return (

This action will delete the secret used to enroll hosts to{" "} {renderTeam()?.name}.

Any hosts that attempt to enroll to Fleet using this secret will be unable to enroll.

You cannot undo this action.

); }; export default DeleteSecretModal;