1- import React , { type FC , useState } from 'react' ;
1+ import React , { type FC , useState , useContext } from 'react' ;
22import { useConfirm } from 'lib/hooks/useConfirm' ;
33import { type CellContext } from '@tanstack/react-table' ;
44import { type BrokerConfig } from 'generated-sources' ;
77 UpdateBrokerConfigCallback ,
88} from 'components/Brokers/Broker/Configs/lib/types' ;
99import { getConfigUnit } from 'components/Brokers/Broker/Configs/lib/utils' ;
10+ import ClusterContext from 'components/contexts/ClusterContext' ;
1011
1112import InputCellViewMode from './InputCellViewMode' ;
1213import InputCellEditMode from './InputCellEditMode' ;
@@ -19,13 +20,7 @@ export interface InputCellProps
1920const InputCell : FC < InputCellProps > = ( { row, onUpdate } ) => {
2021 const [ isEdit , setIsEdit ] = useState ( false ) ;
2122 const confirm = useConfirm ( ) ;
22- const {
23- name,
24- source,
25- value : initialValue ,
26- isSensitive,
27- isReadOnly,
28- } = row . original ;
23+ const { name, source, value : initialValue , isSensitive } = row . original ;
2924
3025 const handleSave = ( newValue : string ) => {
3126 if ( newValue !== initialValue ) {
@@ -38,6 +33,7 @@ const InputCell: FC<InputCellProps> = ({ row, onUpdate }) => {
3833
3934 const isDynamic = source === 'DYNAMIC_BROKER_CONFIG' ;
4035 const configUnit = getConfigUnit ( name ) ;
36+ const { isReadOnly } = useContext ( ClusterContext ) ;
4137
4238 return isEdit ? (
4339 < InputCellEditMode
0 commit comments