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