@@ -16,6 +16,7 @@ import { useNavigate, useSearchParams } from 'react-router-dom';
1616import { CONSUMER_GROUP_STATE_TOOLTIPS , PER_PAGE } from 'lib/constants' ;
1717import { useConsumerGroups } from 'lib/hooks/api/consumers' ;
1818import Tooltip from 'components/common/Tooltip/Tooltip' ;
19+ import BatchActionsBar from './BatchActionsBar' ; // Import the new batch actions bar
1920
2021const List = ( ) => {
2122 const { clusterName } = useAppParams < ClusterNameRoute > ( ) ;
@@ -33,62 +34,55 @@ const List = () => {
3334 search : searchParams . get ( 'q' ) || '' ,
3435 } ) ;
3536
36- const columns = React . useMemo < ColumnDef < ConsumerGroup > [ ] > (
37- ( ) => [
38- {
39- id : ConsumerGroupOrdering . NAME ,
40- header : 'Group ID' ,
41- accessorKey : 'groupId' ,
42- // eslint-disable-next-line react/no-unstable-nested-components
43- cell : ( { getValue } ) => (
44- < LinkCell
45- value = { `${ getValue < string | number > ( ) } ` }
46- to = { encodeURIComponent ( `${ getValue < string | number > ( ) } ` ) }
37+ const columns = React . useMemo < ColumnDef < ConsumerGroup > [ ] > ( ( ) => [
38+ {
39+ id : ConsumerGroupOrdering . NAME ,
40+ header : 'Group ID' ,
41+ accessorKey : 'groupId' ,
42+ cell : ( { getValue } ) => (
43+ < LinkCell
44+ value = { `${ getValue < string | number > ( ) } ` }
45+ to = { encodeURIComponent ( `${ getValue < string | number > ( ) } ` ) }
46+ />
47+ ) ,
48+ } ,
49+ {
50+ id : ConsumerGroupOrdering . MEMBERS ,
51+ header : 'Num Of Members' ,
52+ accessorKey : 'members' ,
53+ } ,
54+ {
55+ id : ConsumerGroupOrdering . TOPIC_NUM ,
56+ header : 'Num Of Topics' ,
57+ accessorKey : 'topics' ,
58+ } ,
59+ {
60+ id : ConsumerGroupOrdering . MESSAGES_BEHIND ,
61+ header : 'Consumer Lag' ,
62+ accessorKey : 'consumerLag' ,
63+ cell : ( args ) => args . getValue ( ) || 'N/A' ,
64+ } ,
65+ {
66+ header : 'Coordinator' ,
67+ accessorKey : 'coordinator.id' ,
68+ enableSorting : false ,
69+ } ,
70+ {
71+ id : ConsumerGroupOrdering . STATE ,
72+ header : 'State' ,
73+ accessorKey : 'state' ,
74+ cell : ( args ) => {
75+ const value = args . getValue ( ) as ConsumerGroupState ;
76+ return (
77+ < Tooltip
78+ value = { < TagCell { ...args } /> }
79+ content = { CONSUMER_GROUP_STATE_TOOLTIPS [ value ] }
80+ placement = "bottom-end"
4781 />
48- ) ,
82+ ) ;
4983 } ,
50- {
51- id : ConsumerGroupOrdering . MEMBERS ,
52- header : 'Num Of Members' ,
53- accessorKey : 'members' ,
54- } ,
55- {
56- id : ConsumerGroupOrdering . TOPIC_NUM ,
57- header : 'Num Of Topics' ,
58- accessorKey : 'topics' ,
59- } ,
60- {
61- id : ConsumerGroupOrdering . MESSAGES_BEHIND ,
62- header : 'Consumer Lag' ,
63- accessorKey : 'consumerLag' ,
64- cell : ( args ) => {
65- return args . getValue ( ) || 'N/A' ;
66- } ,
67- } ,
68- {
69- header : 'Coordinator' ,
70- accessorKey : 'coordinator.id' ,
71- enableSorting : false ,
72- } ,
73- {
74- id : ConsumerGroupOrdering . STATE ,
75- header : 'State' ,
76- accessorKey : 'state' ,
77- // eslint-disable-next-line react/no-unstable-nested-components
78- cell : ( args ) => {
79- const value = args . getValue ( ) as ConsumerGroupState ;
80- return (
81- < Tooltip
82- value = { < TagCell { ...args } /> }
83- content = { CONSUMER_GROUP_STATE_TOOLTIPS [ value ] }
84- placement = "bottom-end"
85- />
86- ) ;
87- } ,
88- } ,
89- ] ,
90- [ ]
91- ) ;
84+ } ,
85+ ] , [ ] ) ;
9286
9387 return (
9488 < >
@@ -100,22 +94,18 @@ const List = () => {
10094 columns = { columns }
10195 pageCount = { consumerGroups . data ?. pageCount || 0 }
10296 data = { consumerGroups . data ?. consumerGroups || [ ] }
103- emptyMessage = {
104- consumerGroups . isSuccess
105- ? 'No active consumer groups found'
106- : 'Loading...'
107- }
97+ emptyMessage = { consumerGroups . isSuccess ? 'No active consumer groups found' : 'Loading...' }
10898 serverSideProcessing
10999 enableSorting
100+ enableRowSelection
101+ batchActionsBar = { BatchActionsBar }
110102 onRowClick = { ( { original } ) =>
111- navigate (
112- clusterConsumerGroupDetailsPath ( clusterName , original . groupId )
113- )
103+ navigate ( clusterConsumerGroupDetailsPath ( clusterName , original . groupId ) )
114104 }
115105 disabled = { consumerGroups . isFetching }
116106 />
117107 </ >
118108 ) ;
119109} ;
120110
121- export default List ;
111+ export default List ;
0 commit comments