2023-06-22 16:37:02 +02:00
|
|
|
import { AdminAlert } from 'component/common/AdminAlert/AdminAlert';
|
2022-07-22 09:31:08 +02:00
|
|
|
import { GroupsList } from './GroupsList/GroupsList';
|
2023-06-22 16:37:02 +02:00
|
|
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
|
|
|
import { useContext } from 'react';
|
|
|
|
import AccessContext from 'contexts/AccessContext';
|
|
|
|
import { ADMIN } from '@server/types/permissions';
|
2022-07-22 09:31:08 +02:00
|
|
|
|
|
|
|
export const GroupsAdmin = () => {
|
2023-06-22 16:37:02 +02:00
|
|
|
const { hasAccess } = useContext(AccessContext);
|
|
|
|
|
2022-07-22 09:31:08 +02:00
|
|
|
return (
|
|
|
|
<div>
|
2023-06-22 16:37:02 +02:00
|
|
|
<ConditionallyRender
|
|
|
|
condition={hasAccess(ADMIN)}
|
|
|
|
show={<GroupsList />}
|
|
|
|
elseShow={<AdminAlert />}
|
|
|
|
/>
|
2022-07-22 09:31:08 +02:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|