import React from 'react';

/**
 *
 * When users have to delete an entity that is integral to the app, it is
 *
 * considered a best practice to add an extra step to confirm if they want to
 *
 * delete the entity. This modal contains an input field where you can ask the user
 *
 * to enter something in order to confirm if they want to delete that component. It
 *
 * can also be used to stress on the fact that the deletion is irreversible. This
 *
 * modal can be used for any other operations apart from deletion. You can see a
 *
 * similar modal being used by GitHub when you delete a repository. GitHub asks you
 *
 * to confirm the deletion by prompting you to enter the name of the repository in
 *
 * an input field.
 *
 * @example 
 *
 * import ConfirmationModal from "@bigbinary/neeto-molecules/ConfirmationModal";
 * 
 * import { deleteProject } from "apis/projectApi.js";
 * 
 * const SendToFieldsComponent = ({ project }) => {
 *   const [isDeleting, setIsDeleting] = useState(false);
 *   const [showModal, setShowModal] = useState(false);
 * 
 *   return (
 *     <ConfirmationModal
 *       buttonLabel="Delete Project"
 *       confirmationText={project.name}
 *       description="Once the project is deleted it cannot be restored. If you want to proceed, enter the name of the project below"
 *       isOpen={showModal}
 *       isSubmitting={isDeleting}
 *       title="Confirm project deletion"
 *       onClose={() => setShowModal(false)}
 *       onSubmit={async () => {
 *         setIsDeleting(true);
 *         await deleteProject(project.name);
 *         setShowModal(false);
 *         setIsDeleting(false);
 *       }}
 *     />
 *   );
 * };
 * @endexample
*/
declare const ConfirmationModal: React.FC<{
  buttonLabel: string;
  confirmationText: string;
  description?: React.ReactNode | React.ReactNode[] | string;
  isOpen?: boolean;
  isSubmitting?: boolean;
  title?: string;
  onClose: Function;
  onSubmit: Function;
  deleteConfirmationMessage?: string;
}>;

export { ConfirmationModal as default };
