kafka-ui/src/components/Topics/TopicsContainer.ts
Oleg Shuralev d9768bce30
Cleanup
2020-01-19 22:44:10 +03:00

23 lines
758 B
TypeScript

import { connect } from 'react-redux';
import { fetchTopicList } from 'redux/reducers/topics/thunks';
import Topics from './Topics';
import { getIsTopicListFetched } from 'redux/reducers/topics/selectors';
import { RootState, ClusterId } from 'lib/interfaces';
import { RouteComponentProps } from 'react-router-dom';
interface RouteProps {
clusterId: string;
}
interface OwnProps extends RouteComponentProps<RouteProps> { }
const mapStateToProps = (state: RootState, { match: { params: { clusterId } }}: OwnProps) => ({
isFetched: getIsTopicListFetched(state),
clusterId,
});
const mapDispatchToProps = {
fetchTopicList: (clusterId: ClusterId) => fetchTopicList(clusterId),
}
export default connect(mapStateToProps, mapDispatchToProps)(Topics);