File tree Expand file tree Collapse file tree 1 file changed +9
-23
lines changed
frontend/src/components/Connect/List/ConnectorsTable/connectorsColumns/cells Expand file tree Collapse file tree 1 file changed +9
-23
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
22import { FullConnectorInfo } from 'generated-sources' ;
33import { CellContext } from '@tanstack/react-table' ;
4- import { useNavigate } from 'react-router-dom' ;
54import { MultiLineTag } from 'components/common/Tag/Tag.styled' ;
65import { ClusterNameRoute , clusterTopicPath } from 'lib/paths' ;
76import useAppParams from 'lib/hooks/useAppParams' ;
@@ -13,31 +12,18 @@ const TopicsCell: React.FC<CellContext<FullConnectorInfo, unknown>> = ({
1312} ) => {
1413 const { topics } = row . original ;
1514 const { clusterName } = useAppParams < ClusterNameRoute > ( ) ;
16- const navigate = useNavigate ( ) ;
17-
18- const navigateToTopic = (
19- e : React . KeyboardEvent | React . MouseEvent ,
20- topic : string
21- ) => {
22- e . preventDefault ( ) ;
23- e . stopPropagation ( ) ;
24- navigate ( clusterTopicPath ( clusterName , topic ) ) ;
25- } ;
2615
2716 return (
2817 < S . TagsWrapper >
29- { topics ?. map ( ( t ) => (
30- < MultiLineTag key = { t } color = "green" >
31- < span
32- role = "link"
33- onClick = { ( e ) => navigateToTopic ( e , t ) }
34- onKeyDown = { ( e ) => navigateToTopic ( e , t ) }
35- tabIndex = { 0 }
36- >
37- { t }
38- </ span >
39- </ MultiLineTag >
40- ) ) }
18+ { topics ?. map ( ( t ) => {
19+ const href = clusterTopicPath ( clusterName , t ) ;
20+
21+ return (
22+ < MultiLineTag key = { t } color = "green" >
23+ < a href = { href } > { t } </ a >
24+ </ MultiLineTag >
25+ ) ;
26+ } ) }
4127 </ S . TagsWrapper >
4228 ) ;
4329} ;
You can’t perform that action at this time.
0 commit comments