// react-hook-form import { Control, Controller } from "react-hook-form"; // hooks import useUser from "lib/hooks/useUser"; // headless ui import { Listbox, Transition } from "@headlessui/react"; // types import { IIssue } from "types"; import { classNames } from "constants/common"; import { CustomMenu, Spinner } from "ui"; import React from "react"; import { ChevronDownIcon, Squares2X2Icon } from "@heroicons/react/24/outline"; import CustomSelect from "ui/custom-select"; type Props = { control: Control; submitChanges: (formData: Partial) => void; }; const SelectState: React.FC = ({ control, submitChanges }) => { const { states } = useUser(); return (

State

( {value ? ( <> option.id === value)?.color, }} > {states?.find((option) => option.id === value)?.name} ) : ( "None" )} } value={value} onChange={(value: any) => { submitChanges({ state: value }); }} > {states ? ( states.length > 0 ? ( states.map((option) => ( <> {option.color && ( )} {option.name} )) ) : (
No states found
) ) : ( )}
)} />
); }; export default SelectState;