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