import { FC } from "react"; import { observer } from "mobx-react-lite"; // hooks // components import { CyclesBoard, CyclesList, CyclesListGanttChartView } from "components/cycles"; // ui components import { CycleModuleBoardLayout, CycleModuleListLayout, GanttLayoutLoader } from "components/ui"; import { useCycle } from "hooks/store"; // types import { TCycleLayout, TCycleView } from "@plane/types"; export interface ICyclesView { filter: TCycleView; layout: TCycleLayout; workspaceSlug: string; projectId: string; peekCycle: string | undefined; } export const CyclesView: FC = observer((props) => { const { filter, layout, workspaceSlug, projectId, peekCycle } = props; // store hooks const { currentProjectCompletedCycleIds, currentProjectDraftCycleIds, currentProjectUpcomingCycleIds, currentProjectCycleIds, loader, } = useCycle(); const cyclesList = filter === "completed" ? currentProjectCompletedCycleIds : filter === "draft" ? currentProjectDraftCycleIds : filter === "upcoming" ? currentProjectUpcomingCycleIds : currentProjectCycleIds; if (loader || !cyclesList) return ( <> {layout === "list" && } {layout === "board" && } {layout === "gantt" && } ); return ( <> {layout === "list" && ( )} {layout === "board" && ( )} {layout === "gantt" && } ); });