import { FC, Fragment, useState } from "react"; import { Listbox, Transition } from "@headlessui/react"; import { CheckIcon, ChevronUpDownIcon } from "@heroicons/react/20/solid"; import { useMobxStore } from "lib/mobx/store-provider"; import { IIssue } from "types"; import { observer } from "mobx-react-lite"; export interface IIssuePrioritySelect { issue: IIssue; groupId: string; } export const IssuePrioritySelect: FC = observer((props) => { const { issue, groupId } = props; const { issueView: issueViewStore, issueFilters: issueFilterStore } = useMobxStore(); const priorityList = issueFilterStore.issueRenderFilters.priority; const selected = priorityList.find((p) => p.key === issue.priority); const changePriority = (selectedPriority: any) => { issueViewStore.updateIssues(groupId, issue.id, { priority: selectedPriority.key }); }; return (
{selected?.title || "None"} {priorityList.map((priority) => ( `relative cursor-default select-none py-2 pl-10 pr-4 ${ active ? "bg-amber-100 text-amber-900" : "text-gray-900" }` } value={priority} > {({ selected }) => ( <> {priority.title} {selected ? ( ) : null} )} ))}
); });