11import React from 'react' ;
22import useAppParams from 'lib/hooks/useAppParams' ;
33import { clusterConnectConnectorPath , ClusterNameRoute } from 'lib/paths' ;
4- import Table , { TagCell } from 'components/common/NewTable' ;
4+ import Table , { LinkCell , TagCell } from 'components/common/NewTable' ;
55import { FullConnectorInfo } from 'generated-sources' ;
66import { useConnectors } from 'lib/hooks/api/kafkaConnect' ;
77import { ColumnDef } from '@tanstack/react-table' ;
88import { useNavigate , useSearchParams } from 'react-router-dom' ;
99import BreakableTextCell from 'components/common/NewTable/BreakableTextCell' ;
1010import { useQueryPersister } from 'components/common/NewTable/ColumnFilter' ;
11+ import { useLocalStoragePersister } from 'components/common/NewTable/ColumnResizer/lib' ;
1112
1213import ActionsCell from './ActionsCell' ;
1314import TopicsCell from './TopicsCell' ;
@@ -17,7 +18,13 @@ const kafkaConnectColumns: ColumnDef<FullConnectorInfo>[] = [
1718 {
1819 header : 'Name' ,
1920 accessorKey : 'name' ,
20- cell : BreakableTextCell ,
21+ cell : ( { getValue } ) => (
22+ < LinkCell
23+ wordBreak
24+ value = { `${ getValue < string | number > ( ) } ` }
25+ to = { encodeURIComponent ( `${ getValue < string | number > ( ) } ` ) }
26+ />
27+ ) ,
2128 enableResizing : true ,
2229 } ,
2330 {
@@ -35,6 +42,7 @@ const kafkaConnectColumns: ColumnDef<FullConnectorInfo>[] = [
3542 accessorKey : 'type' ,
3643 meta : { filterVariant : 'multi-select' } ,
3744 filterFn : 'arrIncludesSome' ,
45+ size : 120 ,
3846 } ,
3947 {
4048 header : 'Plugin' ,
@@ -84,14 +92,15 @@ const List: React.FC = () => {
8492 ) ;
8593
8694 const filterPersister = useQueryPersister ( kafkaConnectColumns ) ;
95+ const columnSizingPersister = useLocalStoragePersister ( 'KafkaConnect' ) ;
8796
8897 return (
8998 < Table
9099 data = { connectors || [ ] }
91100 columns = { kafkaConnectColumns }
92101 enableSorting
93102 enableColumnResizing
94- tableName = "KafkaConnect"
103+ columnSizingPersister = { columnSizingPersister }
95104 onRowClick = { ( { original : { connect, name } } ) =>
96105 navigate ( clusterConnectConnectorPath ( clusterName , connect , name ) )
97106 }
0 commit comments