// react import React from "react"; // next import { useRouter } from "next/router"; // swr import useSWR from "swr"; // react hook form import { Controller } from "react-hook-form"; // services import stateService from "lib/services/state.service"; // constants import { STATE_LIST } from "constants/fetch-keys"; // icons import { PlusIcon } from "@heroicons/react/20/solid"; // ui import { CustomListbox } from "ui"; // icons import { Squares2X2Icon } from "@heroicons/react/24/outline"; // types import type { Control } from "react-hook-form"; import type { IIssue } from "types"; type Props = { control: Control; setIsOpen: React.Dispatch>; }; const SelectState: React.FC = ({ control, setIsOpen }) => { const router = useRouter(); const { workspaceSlug, projectId } = router.query; const { data: states } = useSWR( workspaceSlug && projectId ? STATE_LIST(projectId as string) : null, workspaceSlug && projectId ? () => stateService.getStates(workspaceSlug as string, projectId as string) : null ); return ( ( { return { value: state.id, display: state.name, color: state.color }; })} value={value} optionsFontsize="sm" onChange={onChange} icon={} footerOption={ } /> )} /> ); }; export default SelectState;