// react import React from "react"; // react-hook-form import { Control, Controller } from "react-hook-form"; // hooks import useUser from "lib/hooks/useUser"; // ui import { Spinner, CustomSelect } from "ui"; // icons import { ArrowPathIcon } from "@heroicons/react/24/outline"; // types import { ICycle, IIssue } from "types"; // common import { classNames } from "constants/common"; type Props = { control: Control; handleCycleChange: (cycle: ICycle) => void; }; const SelectCycle: React.FC = ({ control, handleCycleChange }) => { const { cycles } = useUser(); return (

Cycle

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