// react import React from "react"; // react-hook-form import { Control, Controller, UseFormWatch } from "react-hook-form"; // ui import { CustomSelect } from "ui"; // icons import { ChartBarIcon } from "@heroicons/react/24/outline"; // types import { IIssue } from "types"; // common import { classNames } from "constants/common"; // constants import { getPriorityIcon } from "constants/global"; import { PRIORITIES } from "constants/"; 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 ?? "None"} ))} )} />
); }; export default SelectPriority;