import { useContext, VFC } from 'react'; import { PageContent } from 'component/common/PageContent/PageContent'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import { Alert } from '@mui/material'; import { PageHeader } from 'component/common/PageHeader/PageHeader'; import AccessContext from 'contexts/AccessContext'; import { UPDATE_PROJECT } from 'component/providers/AccessProvider/permissions'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; import { usePageTitle } from 'hooks/usePageTitle'; import { ProjectAccessTable } from 'component/project/ProjectAccess/ProjectAccessTable/ProjectAccessTable'; interface IProjectAccess { projectName: string; } export const ProjectAccess: VFC = ({ projectName }) => { const projectId = useRequiredPathParam('projectId'); const { hasAccess } = useContext(AccessContext); const { isOss } = useUiConfig(); usePageTitle(`Project access – ${projectName}`); if (isOss()) { return ( }> Controlling access to projects requires a paid version of Unleash. Check out{' '} getunleash.io {' '} to find out more. ); } if (!hasAccess(UPDATE_PROJECT, projectId)) { return ( }> You need project owner permissions to access this section. ); } return ; };