import { FC } from "react"; import Image from "next/image"; import { observer } from "mobx-react-lite"; // hooks import { useCycle, useCycleFilter } from "hooks/store"; // components import { CyclesBoard, CyclesList, CyclesListGanttChartView } from "components/cycles"; // ui import { CycleModuleBoardLayout, CycleModuleListLayout, GanttLayoutLoader } from "components/ui"; // assets import NameFilterImage from "public/empty-state/cycle/name-filter.svg"; import AllFiltersImage from "public/empty-state/cycle/all-filters.svg"; // types import { TCycleLayoutOptions } from "@plane/types"; export interface ICyclesView { layout: TCycleLayoutOptions; workspaceSlug: string; projectId: string; peekCycle: string | undefined; } export const CyclesView: FC = observer((props) => { const { layout, workspaceSlug, projectId, peekCycle } = props; // store hooks const { getFilteredCycleIds, getFilteredCompletedCycleIds, loader } = useCycle(); const { searchQuery } = useCycleFilter(); // derived values const filteredCycleIds = getFilteredCycleIds(projectId); const filteredCompletedCycleIds = getFilteredCompletedCycleIds(projectId); if (loader || !filteredCycleIds) return ( <> {layout === "list" && } {layout === "board" && } {layout === "gantt" && } ); if (filteredCycleIds.length === 0 && filteredCompletedCycleIds?.length === 0) return (
No matching cycles
No matching cycles

{searchQuery.trim() === "" ? "Remove the filters to see all cycles" : "Remove the search criteria to see all cycles"}

); return ( <> {layout === "list" && ( )} {layout === "board" && ( )} {layout === "gantt" && } ); });