kafka-ui/kafka-ui-react-app/src/components/ConsumerGroups/ConsumerGroups.tsx
soffest c26edd1316
WIP: Consumer groups list with search. (#17)
* 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>
2020-04-07 11:15:48 +03:00

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;