import { useState } from "react"; import { CustomMenu } from "@plane/ui"; import { Copy, Pencil, Trash2 } from "lucide-react"; // components import { CreateUpdateDraftIssueModal, DeleteDraftIssueModal } from "components/issues"; // types import { IIssue } from "types"; type Props = { issue: IIssue; handleUpdate: (data: IIssue, action: any) => Promise | void; }; export const DraftIssueQuickActions: React.FC = (props) => { const { issue, handleUpdate } = props; // states const [createUpdateIssueModal, setCreateUpdateIssueModal] = useState(false); const [issueToEdit, setIssueToEdit] = useState(null); const [deleteIssueModal, setDeleteIssueModal] = useState(false); return ( <> setDeleteIssueModal(false)} /> { setCreateUpdateIssueModal(false); setIssueToEdit(null); }} // pre-populate date only if not editing prePopulateData={!issueToEdit && createUpdateIssueModal ? { ...issue } : {}} data={issueToEdit} /> { e.preventDefault(); e.stopPropagation(); setIssueToEdit(issue); setCreateUpdateIssueModal(true); }} >
Edit draft issue
{ e.preventDefault(); e.stopPropagation(); handleUpdate(issue, "convertToIssue"); }} >
Convert to issue
{ e.preventDefault(); e.stopPropagation(); setDeleteIssueModal(true); }} >
Delete draft issue
); };