import React from 'react'; import { Switch, Route, useParams } from 'react-router-dom'; import { clusterTopicPath, clusterTopicsPath } from 'lib/paths'; import { ClusterName, TopicName } from 'redux/interfaces'; import Breadcrumb from 'components/common/Breadcrumb/Breadcrumb'; import EditContainer from 'components/Topics/Topic/Edit/EditContainer'; import DetailsContainer from 'components/Topics/Topic/Details/DetailsContainer'; import PageLoader from 'components/common/PageLoader/PageLoader'; interface RouterParams { clusterName: ClusterName; topicName: TopicName; } interface TopicProps { isTopicFetching: boolean; fetchTopicDetails: (clusterName: ClusterName, topicName: TopicName) => void; } const Topic: React.FC = ({ isTopicFetching, fetchTopicDetails, }) => { const { clusterName, topicName } = useParams(); React.useEffect(() => { fetchTopicDetails(clusterName, topicName); }, [fetchTopicDetails, clusterName, topicName]); const rootBreadcrumbLinks = [ { href: clusterTopicsPath(clusterName), label: 'All Topics', }, ]; const childBreadcrumbLinks = [ ...rootBreadcrumbLinks, { href: clusterTopicPath(clusterName, topicName), label: topicName, }, ]; const topicPageUrl = '/ui/clusters/:clusterName/topics/:topicName'; return (
Edit {topicName}
{isTopicFetching ? ( ) : ( )}
); }; export default Topic;