import React from 'react'; import { ClusterName, TopicName } from 'redux/interfaces'; import { Topic, TopicDetails } from 'generated-sources'; import { NavLink, Switch, Route, Link, useHistory } from 'react-router-dom'; import { clusterTopicSettingsPath, clusterTopicPath, clusterTopicMessagesPath, clusterTopicsPath, clusterTopicEditPath, } from 'lib/paths'; import ClusterContext from 'components/contexts/ClusterContext'; import ConfirmationModal from 'components/common/ConfirmationModal/ConfirmationModal'; import OverviewContainer from './Overview/OverviewContainer'; import MessagesContainer from './Messages/MessagesContainer'; import SettingsContainer from './Settings/SettingsContainer'; interface Props extends Topic, TopicDetails { clusterName: ClusterName; topicName: TopicName; deleteTopic: (clusterName: ClusterName, topicName: TopicName) => void; clearTopicMessages(clusterName: ClusterName, topicName: TopicName): void; } const Details: React.FC = ({ clusterName, topicName, deleteTopic, clearTopicMessages, }) => { const history = useHistory(); const { isReadOnly } = React.useContext(ClusterContext); const [ isDeleteTopicConfirmationVisible, setDeleteTopicConfirmationVisible, ] = React.useState(false); const deleteTopicHandler = React.useCallback(() => { deleteTopic(clusterName, topicName); history.push(clusterTopicsPath(clusterName)); }, [clusterName, topicName]); const clearTopicMessagesHandler = React.useCallback(() => { clearTopicMessages(clusterName, topicName); }, [clusterName, topicName]); return (

); }; export default Details;