import { FC, ReactNode } from "react"; import { useRouter } from "next/router"; // components import { ProjectSettingsSidebar } from "./sidebar"; import { useMobxStore } from "lib/mobx/store-provider"; import { EUserWorkspaceRoles } from "constants/workspace"; import { NotAuthorizedView } from "components/auth-screens"; import { observer } from "mobx-react-lite"; import { Button, LayersIcon } from "@plane/ui"; export interface IProjectSettingLayout { children: ReactNode; } export const ProjectSettingLayout: FC = observer((props) => { const { children } = props; const router = useRouter(); const { workspaceSlug, projectId } = router.query; const { user: { currentProjectRole }, } = useMobxStore(); const restrictViewSettings = currentProjectRole && currentProjectRole <= EUserWorkspaceRoles.VIEWER; return restrictViewSettings ? ( } onClick={() => router.push(`/${workspaceSlug}/projects/${projectId}/issues`)} > Go to issues } /> ) : (
{children}
); });