import React, { useEffect, useState } from "react"; // headless ui import { Dialog, Transition } from "@headlessui/react"; // types import { IEstimate } from "types"; // icons import { ExclamationTriangleIcon } from "@heroicons/react/24/outline"; // ui import { SecondaryButton, DangerButton } from "components/ui"; type Props = { isOpen: boolean; handleClose: () => void; data: IEstimate; handleDelete: () => void; }; export const DeleteEstimateModal: React.FC = ({ isOpen, handleClose, data, handleDelete, }) => { const [isDeleteLoading, setIsDeleteLoading] = useState(false); useEffect(() => { setIsDeleteLoading(false); }, [isOpen]); const onClose = () => { setIsDeleteLoading(false); handleClose(); }; return (

Delete Estimate

Are you sure you want to delete estimate-{" "} {data.name} {""}? All of the data related to the estiamte will be permanently removed. This action cannot be undone.

Cancel { setIsDeleteLoading(true); handleDelete(); }} loading={isDeleteLoading} > {isDeleteLoading ? "Deleting..." : "Delete Estimate"}
); };