import { FC } from "react"; import { observer } from "mobx-react-lite"; // hooks import { useIssueDetail } from "@/hooks/store"; // components import { IssueDefaultActivity, IssueNameActivity, IssueDescriptionActivity, IssueStateActivity, IssueAssigneeActivity, IssuePriorityActivity, IssueEstimateActivity, IssueParentActivity, IssueRelationActivity, IssueStartDateActivity, IssueTargetDateActivity, IssueCycleActivity, IssueModuleActivity, IssueLabelActivity, IssueLinkActivity, IssueAttachmentActivity, IssueArchivedAtActivity, } from "./actions"; type TIssueActivityList = { activityId: string; ends: "top" | "bottom" | undefined; }; export const IssueActivityList: FC = observer((props) => { const { activityId, ends } = props; // hooks const { activity: { getActivityById }, comment: {}, } = useIssueDetail(); const componentDefaultProps = { activityId, ends }; const activityField = getActivityById(activityId)?.field; switch (activityField) { case null: // default issue creation return ; case "state": return ; case "name": return ; case "description": return ; case "assignees": return ; case "priority": return ; case "estimate_point": return ; case "parent": return ; case ["blocking", "blocked_by", "duplicate", "relates_to"].find((field) => field === activityField): return ; case "start_date": return ; case "target_date": return ; case "cycles": return ; case "modules": return ; case "labels": return ; case "link": return ; case "attachment": return ; case "archived_at": return ; default: return <>; } });