123456789101112131415161718192021222324252627282930313233343536 |
- import { connect } from 'react-redux';
- import { ClusterName, RootState, TopicName } from 'redux/interfaces';
- import { withRouter, RouteComponentProps } from 'react-router-dom';
- import { deleteTopic, clearTopicMessages } from 'redux/actions';
- import { getIsTopicInternal } from 'redux/reducers/topics/selectors';
- import Details from './Details';
- interface RouteProps {
- clusterName: ClusterName;
- topicName: TopicName;
- }
- type OwnProps = RouteComponentProps<RouteProps>;
- const mapStateToProps = (
- state: RootState,
- {
- match: {
- params: { topicName, clusterName },
- },
- }: OwnProps
- ) => ({
- clusterName,
- topicName,
- isInternal: getIsTopicInternal(state, topicName),
- });
- const mapDispatchToProps = {
- deleteTopic,
- clearTopicMessages,
- };
- export default withRouter(
- connect(mapStateToProps, mapDispatchToProps)(Details)
- );
|