refractor: moved all local state, and component to that component,

used dynamic imports where-ever possible
This commit is contained in:
Dakshesh Jain 2022-12-21 19:11:04 +05:30
parent f67bbbf9ff
commit eadebd8d93
7 changed files with 167 additions and 150 deletions

View file

@ -9,13 +9,13 @@ import { Spinner, CustomSelect } from "ui";
// icons
import { ArrowPathIcon } from "@heroicons/react/24/outline";
// types
import { IIssue } from "types";
import { ICycle, IIssue } from "types";
// common
import { classNames } from "constants/common";
type Props = {
control: Control<IIssue, any>;
handleCycleChange: (cycleId: string) => void;
handleCycleChange: (cycle: ICycle) => void;
};
const SelectCycle: React.FC<Props> = ({ control, handleCycleChange }) => {
@ -46,7 +46,7 @@ const SelectCycle: React.FC<Props> = ({ control, handleCycleChange }) => {
}
value={value}
onChange={(value: any) => {
handleCycleChange(value);
handleCycleChange(cycles?.find((c) => c.id === value) as any);
}}
>
{cycles ? (