import { FC } from "react"; import { useRouter } from "next/router"; import { observer } from "mobx-react-lite"; // ui import { Breadcrumbs, CustomMenu } from "@plane/ui"; // helper import { renderEmoji } from "helpers/emoji.helper"; // hooks import { useProject, useUser } from "hooks/store"; // constants import { EUserProjectRoles, PROJECT_SETTINGS_LINKS } from "constants/project"; // components import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; export interface IProjectSettingHeader { title: string; } export const ProjectSettingHeader: FC = observer((props) => { const { title } = props; // router const router = useRouter(); const { workspaceSlug, projectId } = router.query; // store hooks const { membership: { currentProjectRole }, } = useUser(); const { currentProjectDetails } = useProject(); if (currentProjectRole && currentProjectRole <= EUserProjectRoles.VIEWER) return null; return (
{currentProjectDetails?.name.charAt(0)} ) } link={`/${workspaceSlug}/projects/${currentProjectDetails?.id}/issues`} />
{title} } placement="bottom-start" closeOnSelect > {PROJECT_SETTINGS_LINKS.map((item) => ( router.push(`/${workspaceSlug}/projects/${projectId}${item.href}`)}> {item.label} ))}
); });