plane/apps/app/components/project/issues/CreateUpdateIssueModal/SelectParentIssue.tsx

38 lines
969 B
TypeScript
Raw Normal View History

import React, { useEffect, useState } from "react";
2022-12-03 13:41:07 +00:00
// react hook form
import { Controller, Control } from "react-hook-form";
// hooks
import useUser from "lib/hooks/useUser";
// types
import type { IIssue, IssueResponse } from "types";
2022-12-03 13:41:07 +00:00
// icons
import { UserIcon } from "@heroicons/react/24/outline";
// components
import IssuesListModal from "components/project/issues/issues-list-modal";
2022-12-03 13:41:07 +00:00
type Props = {
control: Control<IIssue, any>;
isOpen: boolean;
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
issues: IIssue[];
2022-12-03 13:41:07 +00:00
};
const SelectParent: React.FC<Props> = ({ control, isOpen, setIsOpen, issues }) => {
2022-12-03 13:41:07 +00:00
return (
<Controller
control={control}
name="parent"
render={({ field: { value, onChange } }) => (
<IssuesListModal
isOpen={isOpen}
handleClose={() => setIsOpen(false)}
onChange={onChange}
issues={issues}
/>
2022-12-03 13:41:07 +00:00
)}
/>
);
};
export default SelectParent;