// react import React from "react"; // react-hook-form import { Control, Controller, UseFormWatch } from "react-hook-form"; // ui import { ChartBarIcon } from "@heroicons/react/24/outline"; import { CustomSelect } from "components/ui"; // icons // types import { IIssue } from "types"; // 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 }) => (

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;