import React, { useState } from "react"; import { useRouter } from "next/router"; // icons import { UserIcon } from "@heroicons/react/24/outline"; // components import { ParentIssuesListModal } from "components/issues"; // types import { IIssue, ISearchIssueResponse, UserAuth } from "types"; type Props = { onChange: (value: string) => void; issueDetails: IIssue | undefined; userAuth: UserAuth; disabled?: boolean; }; export const SidebarParentSelect: React.FC = ({ onChange, issueDetails, userAuth, disabled = false, }) => { const [isParentModalOpen, setIsParentModalOpen] = useState(false); const [selectedParentIssue, setSelectedParentIssue] = useState(null); const router = useRouter(); const { projectId, issueId } = router.query; const isNotAllowed = userAuth.isGuest || userAuth.isViewer || disabled; return (

Parent

setIsParentModalOpen(false)} onChange={(issue) => { onChange(issue.id); setSelectedParentIssue(issue); }} issueId={issueId as string} projectId={projectId as string} />
); };