import { FC, ReactNode } from "react"; import { observer } from "mobx-react-lite"; import Link from "next/link"; import { useRouter } from "next/router"; // hooks // components import { Button, LayersIcon } from "@plane/ui"; import { NotAuthorizedView } from "@/components/auth-screens"; // ui // constants import { EUserProjectRoles } from "@/constants/project"; import { useUser } from "@/hooks/store"; import { ProjectSettingsSidebar } from "./sidebar"; 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 ? ( } /> ) : (
{children}
); });