kafka-ui/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/OverviewContainer.ts
2021-03-16 00:03:02 +03:00

25 lines
635 B
TypeScript

import { connect } from 'react-redux';
import { RootState, TopicName, ClusterName } from 'redux/interfaces';
import { getTopicByName } from 'redux/reducers/topics/selectors';
import { withRouter, RouteComponentProps } from 'react-router-dom';
import Overview from './Overview';
interface RouteProps {
clusterName: ClusterName;
topicName: TopicName;
}
type OwnProps = RouteComponentProps<RouteProps>;
const mapStateToProps = (
state: RootState,
{
match: {
params: { topicName },
},
}: OwnProps
) => ({
...getTopicByName(state, topicName),
});
export default withRouter(connect(mapStateToProps)(Overview));