import { observer } from "mobx-react"; import { useParams, useSearchParams } from "next/navigation"; import { FileText } from "lucide-react"; // ui import { Breadcrumbs, Button } from "@plane/ui"; // helpers import { BreadcrumbLink, Logo } from "@/components/common"; // constants import { EPageAccess } from "@/constants/page"; import { EUserProjectRoles } from "@/constants/project"; // hooks import { useCommandPalette, useEventTracker, useProject, useUser } from "@/hooks/store"; const PagesHeader = observer(() => { // router const { workspaceSlug } = useParams(); const searchParams = useSearchParams(); const pageType = searchParams.get("type"); // store hooks const { toggleCreatePageModal } = useCommandPalette(); const { membership: { currentProjectRole }, } = useUser(); const { currentProjectDetails } = useProject(); const { setTrackElement } = useEventTracker(); const canUserCreatePage = currentProjectRole && [EUserProjectRoles.ADMIN, EUserProjectRoles.MEMBER].includes(currentProjectRole); return (
) } /> } /> } />} />
{canUserCreatePage && (
)}
); }); export default PagesHeader;