import React, { useState } from "react"; // headless ui import { Dialog, Transition } from "@headlessui/react"; // ui import { SecondaryButton, PrimaryButton } from "components/ui"; type Props = { isOpen: boolean; handleClose: () => void; onDiscard: () => void; onConfirm: () => Promise; }; export const ConfirmIssueDiscard: React.FC = (props) => { const { isOpen, handleClose, onDiscard, onConfirm } = props; const [isLoading, setIsLoading] = useState(false); const onClose = () => { handleClose(); setIsLoading(false); }; const handleDeletion = async () => { setIsLoading(true); await onConfirm(); setIsLoading(false); }; return (
Draft Issue

Would you like to save this issue in drafts?

Discard
Cancel {isLoading ? "Saving..." : "Save Draft"}
); };