1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-06 00:07:44 +01:00
unleash.unleash/frontend/src/component/admin/groups/GroupsAdmin.tsx

21 lines
673 B
TypeScript
Raw Normal View History

import { AdminAlert } from 'component/common/AdminAlert/AdminAlert';
import { GroupsList } from './GroupsList/GroupsList';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
import { useContext } from 'react';
import AccessContext from 'contexts/AccessContext';
import { ADMIN } from '@server/types/permissions';
export const GroupsAdmin = () => {
const { hasAccess } = useContext(AccessContext);
return (
<div>
<ConditionallyRender
condition={hasAccess(ADMIN)}
show={<GroupsList />}
elseShow={<AdminAlert />}
/>
</div>
);
};