// 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 { Spinner } from "ui"; import React from "react"; import { ArrowPathIcon, ChevronDownIcon } from "@heroicons/react/24/outline"; import CustomSelect from "ui/custom-select"; type Props = { control: Control; handleCycleChange: (cycleId: string) => void; }; const SelectCycle: React.FC = ({ control, handleCycleChange }) => { const { cycles } = useUser(); return (

Cycle

( <> {value ? cycles?.find((c) => c.id === value)?.name : "None"} } value={value} onChange={(value: any) => { handleCycleChange(value); }} > {cycles ? ( cycles.length > 0 ? ( cycles.map((option) => ( {option.name} )) ) : (
No cycles found
) ) : ( )}
)} />
); }; export default SelectCycle;