import React from "react"; // react hook form import { Controller } from "react-hook-form"; // headless ui import { Listbox, Transition } from "@headlessui/react"; // hooks import useUser from "lib/hooks/useUser"; // components import CreateUpdateSprintsModal from "components/project/cycles/CreateUpdateCyclesModal"; // icons import { CheckIcon, ChevronDownIcon, PlusIcon } from "@heroicons/react/20/solid"; // types import type { IIssue } from "types"; import type { Control } from "react-hook-form"; import { ArrowPathIcon } from "@heroicons/react/24/outline"; type Props = { control: Control; setIsOpen: React.Dispatch>; }; const SelectSprint: React.FC = ({ control, setIsOpen }) => { const { cycles } = useUser(); return ( <> ( {({ open }) => ( <>
{cycles?.find((i) => i.id.toString() === value?.toString())?.name ?? "Cycle"}
{cycles?.map((cycle) => ( `relative cursor-pointer select-none p-2 rounded-md ${ active ? "bg-theme text-white" : "text-gray-900" }` } > {({ active, selected }) => ( <> {cycle.name} )} ))}
)}
)} /> ); }; export default SelectSprint;