kafka-ui/kafka-ui-react-app/src/components/Topics/Topics.tsx
Azat Belgibayev e569e46a8a
Refactor breadcrumbs params detection (#1394)
Co-authored-by: Oleg Shur <workshur@gmail.com>
2022-01-25 12:01:37 +03:00

33 lines
812 B
TypeScript

import React from 'react';
import { Switch } from 'react-router-dom';
import {
clusterTopicNewPath,
clusterTopicPath,
clusterTopicsPath,
} from 'lib/paths';
import { BreadcrumbRoute } from 'components/common/Breadcrumb/Breadcrumb.route';
import ListContainer from './List/ListContainer';
import TopicContainer from './Topic/TopicContainer';
import New from './New/New';
const Topics: React.FC = () => (
<Switch>
<BreadcrumbRoute
exact
path={clusterTopicsPath(':clusterName')}
component={ListContainer}
/>
<BreadcrumbRoute
exact
path={clusterTopicNewPath(':clusterName')}
component={New}
/>
<BreadcrumbRoute
path={clusterTopicPath(':clusterName', ':topicName')}
component={TopicContainer}
/>
</Switch>
);
export default Topics;