diff --git a/web/components/pages/pages-list-main-content.tsx b/web/components/pages/pages-list-main-content.tsx index 60e11dd8c..ae01085d6 100644 --- a/web/components/pages/pages-list-main-content.tsx +++ b/web/components/pages/pages-list-main-content.tsx @@ -8,7 +8,7 @@ import { PageLoader } from "@/components/pages"; // constants import { EmptyStateType } from "@/constants/empty-state"; // hooks -import { useProjectPages } from "@/hooks/store"; +import { useApplication, 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"; @@ -23,6 +23,7 @@ export const PagesListMainContent: React.FC = observer((props) => { const { children, pageType, projectId } = props; // store hooks const { loader, getCurrentProjectFilteredPageIds, getCurrentProjectPageIds, filters } = useProjectPages(projectId); + const { commandPalette: commandPaletteStore } = useApplication(); // derived values const pageIds = getCurrentProjectPageIds(pageType); const filteredPageIds = getCurrentProjectFilteredPageIds(pageType); @@ -30,8 +31,24 @@ export const PagesListMainContent: React.FC = observer((props) => { 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 === "public") + return ( + { + commandPaletteStore.toggleCreatePageModal(true); + }} + /> + ); + if (pageType === "private") + return ( + { + commandPaletteStore.toggleCreatePageModal(true); + }} + /> + ); if (pageType === "archived") return ; } // if no pages match the filter criteria diff --git a/web/constants/empty-state.ts b/web/constants/empty-state.ts index d62c8808e..9ca6f4edb 100644 --- a/web/constants/empty-state.ts +++ b/web/constants/empty-state.ts @@ -500,12 +500,22 @@ const emptyStateDetails = { title: "No private pages yet", description: "Keep your private thoughts here. When you're ready to share, the team's just a click away.", path: "/empty-state/pages/private", + primaryButton: { + text: "Create your first page", + }, + accessType: "project", + access: EUserProjectRoles.MEMBER, }, [EmptyStateType.PROJECT_PAGE_PUBLIC]: { key: EmptyStateType.PROJECT_PAGE_PUBLIC, title: "No public pages yet", description: "See pages shared with everyone in your project right here.", path: "/empty-state/pages/public", + primaryButton: { + text: "Create your first page", + }, + accessType: "project", + access: EUserProjectRoles.MEMBER, }, [EmptyStateType.PROJECT_PAGE_ARCHIVED]: { key: EmptyStateType.PROJECT_PAGE_ARCHIVED,