import React from "react"; // hooks import { useIssueDetail } from "hooks/store"; // helpers import { renderFormattedDate } from "helpers/date-time.helper"; // types type Props = { issueId: string; expandedIssues: string[]; }; export const SpreadsheetCreatedOnColumn: React.FC = ({ issueId, expandedIssues }) => { const isExpanded = expandedIssues.indexOf(issueId) > -1; const { subIssues: subIssuesStore, issue } = useIssueDetail(); const issueDetail = issue.getIssueById(issueId); const subIssues = subIssuesStore.subIssuesByIssueId(issueId); return ( <> {issueDetail && (
{renderFormattedDate(issueDetail.created_at)}
)} {isExpanded && subIssues && subIssues.length > 0 && subIssues.map((subIssueId: string) => (
))} ); };