import React, { useState } from "react"; // ui import { Icon } from "components/ui"; import { ChevronDown, PenSquare } from "lucide-react"; // headless ui import { Menu, Transition } from "@headlessui/react"; // hooks import useLocalStorage from "hooks/use-local-storage"; // components import { CreateUpdateDraftIssueModal } from "components/issues"; // mobx store import { useMobxStore } from "lib/mobx/store-provider"; export const WorkspaceSidebarQuickAction = () => { const store: any = useMobxStore(); const [isDraftIssueModalOpen, setIsDraftIssueModalOpen] = useState(false); const { storedValue, clearValue } = useLocalStorage("draftedIssue", null); return ( <> setIsDraftIssueModalOpen(false)} prePopulateData={storedValue ? JSON.parse(storedValue) : {}} onSubmit={() => { localStorage.removeItem("draftedIssue"); clearValue(); setIsDraftIssueModalOpen(false); }} fieldsToShow={[ "name", "description", "label", "assignee", "priority", "dueDate", "priority", "state", "startDate", "project", ]} />
{storedValue &&
} {storedValue && (
{({ open }) => ( <>
)}
)}
); };