import React from "react"; // next imports import Link from "next/link"; // lucide icons import { ChevronDown, ChevronRight, X, Pencil, Trash, Link as LinkIcon, Loader, } from "lucide-react"; // components import { SubIssuesRootList } from "./issues-list"; import { IssueProperty } from "./properties"; // ui import { Tooltip, CustomMenu } from "components/ui"; // types import { ICurrentUserResponse, IIssue } from "types"; export interface ISubIssues { workspaceSlug: string; projectId: string; parentIssue: IIssue; issue: any; spacingLeft?: number; user: ICurrentUserResponse | undefined; editable: boolean; removeIssueFromSubIssues: (parentIssueId: string, issue: IIssue) => void; issuesVisibility: string[]; handleIssuesVisibility: (issueId: string) => void; copyText: (text: string) => void; handleIssueCrudOperation: ( key: "create" | "existing" | "edit" | "delete", issueId: string, issue?: IIssue | null ) => void; } export const SubIssues: React.FC = ({ workspaceSlug, projectId, parentIssue, issue, spacingLeft = 0, user, editable, removeIssueFromSubIssues, issuesVisibility, handleIssuesVisibility, copyText, handleIssueCrudOperation, }) => (
{issue && (
{issue?.sub_issues_count > 0 && ( <> {true ? (
handleIssuesVisibility(issue?.id)} > {issuesVisibility && issuesVisibility.includes(issue?.id) ? ( ) : ( )}
) : ( )} )}
{issue.project_detail.identifier}-{issue?.sequence_id}
{issue?.name}
{editable && ( handleIssueCrudOperation("edit", parentIssue?.id, issue)} >
Edit issue
)} {editable && ( handleIssueCrudOperation("delete", parentIssue?.id, issue)} >
Delete issue
)}
Copy issue link
{editable && (
removeIssueFromSubIssues(parentIssue?.id, issue)} >
)}
)} {issuesVisibility.includes(issue?.id) && issue?.sub_issues_count > 0 && ( )}
);