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/create-update-cycle-modal"; // 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) => ( `text-gray-900 cursor-pointer select-none p-2 ${ active ? "bg-indigo-50" : "" }` } > {({ active, selected }) => ( <> {cycle.name} )} ))}
)}
)} /> ); }; export default SelectSprint;