import { observer } from "mobx-react"; import Image from "next/image"; // types import { TPageNavigationTabs } from "@plane/types"; // components import { EmptyState } from "@/components/empty-state"; import { PageLoader } from "@/components/pages"; // constants import { EmptyStateType } from "@/constants/empty-state"; // hooks import { useProjectPages } from "@/hooks/store"; // assets import AllFiltersImage from "public/empty-state/pages/all-filters.svg"; import NameFilterImage from "public/empty-state/pages/name-filter.svg"; type Props = { children: React.ReactNode; pageType: TPageNavigationTabs; projectId: string; }; export const PagesListMainContent: React.FC = observer((props) => { const { children, pageType, projectId } = props; // store hooks const { loader, getCurrentProjectFilteredPageIds, getCurrentProjectPageIds, filters } = useProjectPages(projectId); // derived values const pageIds = getCurrentProjectPageIds(pageType); const filteredPageIds = getCurrentProjectFilteredPageIds(pageType); if (loader === "init-loader") return ; // if no pages exist in the active page type if (pageIds?.length === 0) { if (pageType === "public") return ; if (pageType === "private") return ; if (pageType === "archived") return ; } // if no pages match the filter criteria if (filteredPageIds?.length === 0) return (
0 ? NameFilterImage : AllFiltersImage} className="h-36 sm:h-48 w-36 sm:w-48 mx-auto" alt="No matching modules" />
No matching pages

{filters.searchQuery.length > 0 ? "Remove the search criteria to see all pages" : "Remove the filters to see all pages"}

); return
{children}
; });