import React, { useState } from "react"; // ui import { ChevronDown, PenSquare, Search } from "lucide-react"; // hooks import useLocalStorage from "hooks/use-local-storage"; // components import { CreateUpdateDraftIssueModal } from "components/issues"; // mobx store import { useMobxStore } from "lib/mobx/store-provider"; import { observer } from "mobx-react-lite"; import { EProjectStore } from "store/command-palette.store"; export const WorkspaceSidebarQuickAction = observer(() => { // states const [isDraftIssueModalOpen, setIsDraftIssueModalOpen] = useState(false); const { theme: themeStore, commandPalette: commandPaletteStore, trackEvent: { setTrackElement }, } = useMobxStore(); const { storedValue, clearValue } = useLocalStorage("draftedIssue", JSON.stringify({})); const isSidebarCollapsed = themeStore.sidebarCollapsed; return ( <> setIsDraftIssueModalOpen(false)} prePopulateData={storedValue ? JSON.parse(storedValue) : {}} onSubmit={() => { localStorage.removeItem("draftedIssue"); clearValue(); }} fieldsToShow={["all"]} />
{storedValue && Object.keys(JSON.parse(storedValue)).length > 0 && ( <>
)}
); });