import { FC } from "react"; import { observer } from "mobx-react-lite"; import Image from "next/image"; // components import { CyclesList } from "@/components/cycles"; // ui import { CycleModuleListLayout } from "@/components/ui"; // hooks import { useCycle, useCycleFilter } from "@/hooks/store"; // assets import AllFiltersImage from "public/empty-state/cycle/all-filters.svg"; import NameFilterImage from "public/empty-state/cycle/name-filter.svg"; export interface ICyclesView { workspaceSlug: string; projectId: string; } export const CyclesView: FC = observer((props) => { const { workspaceSlug, projectId } = props; // store hooks const { getFilteredCycleIds, getFilteredCompletedCycleIds, loader, currentProjectActiveCycleId } = useCycle(); const { searchQuery } = useCycleFilter(); // derived values const filteredCycleIds = getFilteredCycleIds(projectId, false); const filteredCompletedCycleIds = getFilteredCompletedCycleIds(projectId); const filteredUpcomingCycleIds = (filteredCycleIds ?? []).filter( (cycleId) => cycleId !== currentProjectActiveCycleId ); if (loader || !filteredCycleIds) return ; 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 ( <> ); });