import React from "react"; // ui import { Listbox, Transition } from "@headlessui/react"; // icons import { getPriorityIcon } from "components/icons/priority-icon"; // types import { IIssue } from "types"; // constants import { PRIORITIES } from "constants/project"; type Props = { issue: IIssue; partialUpdateIssue: (formData: Partial) => void; position?: "left" | "right"; isNotAllowed: boolean; }; export const ViewPrioritySelect: React.FC = ({ issue, partialUpdateIssue, position = "right", isNotAllowed, }) => ( { partialUpdateIssue({ priority: data }); }} className="group relative flex-shrink-0" disabled={isNotAllowed} > {({ open }) => (
{getPriorityIcon( issue.priority && issue.priority !== "" ? issue.priority ?? "" : "None", "text-sm" )} {PRIORITIES?.map((priority) => ( `flex cursor-pointer select-none items-center gap-x-2 px-3 py-2 capitalize ${ active ? "bg-indigo-50" : "bg-white" }` } value={priority} > {getPriorityIcon(priority, "text-sm")} {priority ?? "None"} ))}
)}
);