
* Added concumer groups list with search. * added endpoint for group consumers * removed redundand code and imports * changed method to async mono * method located better * changes after review * changed foreach to map Co-authored-by: Sofia Shnaidman <sshnaidman@provectus.com> Co-authored-by: Roman Nedzvetskiy <roman@Romans-MacBook-Pro.local>
34 lines
829 B
TypeScript
34 lines
829 B
TypeScript
import React from 'react';
|
|
import { ClusterName } from 'redux/interfaces';
|
|
import {
|
|
Switch,
|
|
Route,
|
|
} from 'react-router-dom';
|
|
import ListContainer from './List/ListContainer';
|
|
import PageLoader from 'components/common/PageLoader/PageLoader';
|
|
|
|
interface Props {
|
|
clusterName: ClusterName;
|
|
isFetched: boolean;
|
|
fetchConsumerGroupsList: (clusterName: ClusterName) => void;
|
|
}
|
|
|
|
const ConsumerGroups: React.FC<Props> = ({
|
|
clusterName,
|
|
isFetched,
|
|
fetchConsumerGroupsList,
|
|
}) => {
|
|
React.useEffect(() => { fetchConsumerGroupsList(clusterName); }, [fetchConsumerGroupsList, clusterName]);
|
|
|
|
if (isFetched) {
|
|
return (
|
|
<Switch>
|
|
<Route exact path="/clusters/:clusterName/consumer-groups" component={ListContainer} />
|
|
</Switch>
|
|
);
|
|
}
|
|
|
|
return (<PageLoader />);
|
|
};
|
|
|
|
export default ConsumerGroups;
|