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"; export interface IIssuePrioritySelect { issue: IIssue; groupId: string; } export const IssuePrioritySelect: FC = (props) => { const { issue, groupId } = props; const { issueFilters: issueFilterStore } = useMobxStore(); const priorityList = issueFilterStore.issueRenderFilters.priority; const selected = priorityList.find((p) => p.key === issue.priority); const changePriority = (selectedPriority: any) => { console.log("selectedPriority", selectedPriority); }; 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} )} ))}
); };