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