// 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, UserAuth } from "types"; // common // constants import { getPriorityIcon } from "constants/global"; import { PRIORITIES } from "constants/"; type Props = { control: Control; submitChanges: (formData: Partial) => void; userAuth: UserAuth; }; const SelectPriority: React.FC = ({ control, submitChanges, userAuth }) => { const isNotAllowed = userAuth.isGuest || userAuth.isViewer; return (

Priority

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