import { FC, Fragment, Dispatch, SetStateAction, useState } from "react"; import { AlertTriangle } from "lucide-react"; // headless ui import { Dialog, Transition } from "@headlessui/react"; // ui import { Button } from "@plane/ui"; // helper import { getFileName } from "helpers/attachment.helper"; // types import type { TIssueAttachment } from "@plane/types"; import { TAttachmentOperations } from "./root"; export type TAttachmentOperationsRemoveModal = Exclude; type Props = { isOpen: boolean; setIsOpen: Dispatch>; data: TIssueAttachment; handleAttachmentOperations: TAttachmentOperationsRemoveModal; }; export const IssueAttachmentDeleteModal: FC = (props) => { const { isOpen, setIsOpen, data, handleAttachmentOperations } = props; // state const [loader, setLoader] = useState(false); const handleClose = () => { setIsOpen(false); setLoader(false); }; const handleDeletion = async (assetId: string) => { setLoader(true); handleAttachmentOperations.remove(assetId).finally(() => handleClose()); }; return ( data && (
Delete Attachment

Are you sure you want to delete attachment-{" "} {getFileName(data.attributes.name)}? This attachment will be permanently removed. This action cannot be undone.

) ); };