import React from "react"; // hooks import { useIssueDetail } from "hooks/store"; type Props = { issueId: string; expandedIssues: string[]; }; export const SpreadsheetSubIssueColumn: React.FC = (props) => { const { issueId, expandedIssues } = props; const isExpanded = expandedIssues.indexOf(issueId) > -1; // const { subIssues, isLoading } = useSubIssue(issue.project_id, issue.id, isExpanded); const { subIssues: subIssuesStore, issue } = useIssueDetail(); const issueDetail = issue.getIssueById(issueId); const subIssues = subIssuesStore.subIssuesByIssueId(issueId); return ( <>
{issueDetail?.sub_issues_count} {issueDetail?.sub_issues_count === 1 ? "sub-issue" : "sub-issues"}
{isExpanded && subIssues && subIssues.length > 0 && subIssues.map((subIssueId: string) => (
))} ); };