// react import React from "react"; // react-hook-form import { Control, Controller, UseFormWatch } from "react-hook-form"; // headless ui import { Listbox, Transition } from "@headlessui/react"; // icons import { ChevronDownIcon, ChartBarIcon } from "@heroicons/react/24/outline"; // types import { IIssue } from "types"; // constants import { classNames } from "constants/common"; import { PRIORITIES } from "constants/"; import CustomSelect from "ui/custom-select"; import { getPriorityIcon } from "constants/global"; type Props = { control: Control; submitChanges: (formData: Partial) => void; watch: UseFormWatch; }; const SelectPriority: React.FC = ({ control, submitChanges, watch }) => { return (

Priority

( {getPriorityIcon( watch("priority") && watch("priority") !== "" ? watch("priority") ?? "" : "None", "text-sm" )} {watch("priority") && watch("priority") !== "" ? watch("priority") : "None"} } value={value} onChange={(value: any) => { submitChanges({ priority: value }); }} > {PRIORITIES.map((option) => ( <> {getPriorityIcon(option, "text-sm")} {option} ))} )} />
); }; export default SelectPriority;