mirror of
https://github.com/Unleash/unleash.git
synced 2025-11-24 20:06:55 +01:00
Follows up on https://github.com/Unleash/unleash/pull/4853 to add Biome to the frontend as well.  Added a few `biome-ignore` to speed up the process but we may want to check and fix them in the future.
35 lines
1.4 KiB
TypeScript
35 lines
1.4 KiB
TypeScript
import { Route, Routes } from 'react-router-dom';
|
|
import { UG } from 'component/common/flags';
|
|
import { PermissionGuard } from 'component/common/PermissionGuard/PermissionGuard';
|
|
import { GroupsList } from './GroupsList/GroupsList';
|
|
import { ADMIN } from '@server/types/permissions';
|
|
import { CreateGroup } from './CreateGroup/CreateGroup';
|
|
import { EditGroupContainer } from './EditGroup/EditGroup';
|
|
import { Group } from './Group/Group';
|
|
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
|
import { PremiumFeature } from 'component/common/PremiumFeature/PremiumFeature';
|
|
|
|
export const GroupsAdmin = () => {
|
|
const { uiConfig, isEnterprise } = useUiConfig();
|
|
|
|
if (isEnterprise() || uiConfig.flags[UG] === true) {
|
|
return (
|
|
<div>
|
|
<PermissionGuard permissions={ADMIN}>
|
|
<Routes>
|
|
<Route index element={<GroupsList />} />
|
|
<Route path='create-group' element={<CreateGroup />} />
|
|
<Route
|
|
path=':groupId/edit'
|
|
element={<EditGroupContainer />}
|
|
/>
|
|
<Route path=':groupId' element={<Group />} />
|
|
</Routes>
|
|
</PermissionGuard>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
return <PremiumFeature feature='groups' page />;
|
|
};
|