// 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"; type Props = { control: Control; handleCycleChange: (cycleId: string) => void; }; const SelectCycle: React.FC = ({ control, handleCycleChange }) => { const { cycles } = useUser(); return (

Cycle

( { handleCycleChange(value); }} className="flex-shrink-0" > {({ open }) => (
{value ? cycles?.find((c) => c.id === value)?.name : "None"}
{cycles ? ( cycles.length > 0 ? ( cycles.map((option) => ( `${ active || selected ? "text-white bg-theme" : "text-gray-900" } flex items-center gap-2 cursor-pointer select-none relative p-2 rounded-md truncate` } value={option.id} > {option.name} )) ) : (
No cycles found
) ) : ( )}
)}
)} />
); }; export default SelectCycle;