import { useRouter } from "next/router"; import { observer } from "mobx-react-lite"; import { FileText, Plus } from "lucide-react"; // hooks import { useMobxStore } from "lib/mobx/store-provider"; // ui import { Breadcrumbs, Button } from "@plane/ui"; // helper import { renderEmoji } from "helpers/emoji.helper"; // constants import { EUserWorkspaceRoles } from "constants/workspace"; export const PagesHeader = observer(() => { // router const router = useRouter(); const { workspaceSlug } = router.query; // mobx store const { user: { currentProjectRole }, project: { currentProjectDetails }, commandPalette: { toggleCreatePageModal }, } = useMobxStore(); const canUserCreatePage = currentProjectRole && [EUserWorkspaceRoles.ADMIN, EUserWorkspaceRoles.MEMBER].includes(currentProjectRole); return (
{currentProjectDetails?.name.charAt(0)} ) } link={`/${workspaceSlug}/projects/${currentProjectDetails?.id}/issues`} /> } label="Pages" />
{canUserCreatePage && (
)}
); });