import { observer } from "mobx-react"; import { useRouter } from "next/router"; import { FileText } from "lucide-react"; // hooks // ui import { Breadcrumbs, Button } from "@plane/ui"; // helpers import { BreadcrumbLink } from "@/components/common"; import { ProjectLogo } from "@/components/project"; import { EUserProjectRoles } from "@/constants/project"; // constants // components import { useCommandPalette, useEventTracker, useProject, useUser } from "@/hooks/store"; export const PagesHeader = observer(() => { // router const router = useRouter(); const { workspaceSlug } = router.query; // 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 && (
)}
); });