import { FC } from "react"; import Link from "next/link"; import { MinusCircle } from "lucide-react"; // component // ui import { CustomMenu } from "@plane/ui"; // hooks import { useIssues, useProject, useProjectState } from "hooks/store"; // types import { TIssue } from "@plane/types"; import { TIssueOperations } from "../root"; import { IssueParentSiblings } from "./siblings"; export type TIssueParentDetail = { workspaceSlug: string; projectId: string; issueId: string; issue: TIssue; issueOperations: TIssueOperations; }; export const IssueParentDetail: FC = (props) => { const { workspaceSlug, projectId, issueId, issue, issueOperations } = props; // hooks const { issueMap } = useIssues(); const { getProjectById } = useProject(); const { getProjectStates } = useProjectState(); const parentIssue = issueMap?.[issue.parent_id || ""] || undefined; const issueParentState = getProjectStates(parentIssue?.project_id)?.find( (state) => state?.id === parentIssue?.state_id ); const stateColor = issueParentState?.color || undefined; if (!parentIssue) return <>; return ( <>
{getProjectById(parentIssue.project_id)?.identifier}-{parentIssue?.sequence_id}
{(parentIssue?.name ?? "").substring(0, 50)}
Sibling issues
issueOperations.update(workspaceSlug, projectId, issueId, { parent_id: null })} className="flex items-center gap-2 py-2 text-red-500" > Remove Parent Issue
); };