@@ -214,10 +214,10 @@ const TableContent = <
214214 ( state : boolean ) =>
215215 ( { detail : { activeRowData } } ) => {
216216 if ( ( activeRowData as RowType < RowData > ) . expandableRows ) {
217- setExpandState ( {
218- ...expandState ,
217+ setExpandState ( ( prev ) => ( {
218+ ...prev ,
219219 [ activeRowData . id ] : state ,
220- } )
220+ } ) )
221221 }
222222 }
223223
@@ -297,16 +297,16 @@ const TableContent = <
297297 return Object . values ( bulkSelectionState )
298298 }
299299
300+ const showIconOrExpandActionGutter = isBulkSelectionConfigured || ! ! rowStartIconConfig || isAnyRowExpandable
301+
300302 const renderRows = ( ) => {
301303 if ( loading && ! visibleColumns . length ) {
302304 return SHIMMER_DUMMY_ARRAY . map ( ( shimmerRowLabel ) => (
303305 < div
304306 key = { shimmerRowLabel }
305307 className = { `px-20 flex left py-12 dc__gap-16 ${ showSeparatorBetweenRows ? 'border__secondary--bottom' : '' } ` }
306308 >
307- { isBulkSelectionConfigured || rowStartIconConfig || isAnyRowExpandable ? (
308- < div className = "shimmer w-20" />
309- ) : null }
309+ { showIconOrExpandActionGutter ? < div className = "shimmer w-20" /> : null }
310310 { SHIMMER_DUMMY_ARRAY . map ( ( shimmerCellLabel ) => (
311311 < div key = { shimmerCellLabel } className = "shimmer w-200" />
312312 ) ) }
@@ -323,7 +323,7 @@ const TableContent = <
323323 gridTemplateColumns,
324324 } }
325325 >
326- { isBulkSelectionConfigured || rowStartIconConfig || isAnyRowExpandable ? (
326+ { showIconOrExpandActionGutter ? (
327327 < div className = "py-12 flex" aria-label = "Loading..." >
328328 < div className = "shimmer h-16 w-20" />
329329 </ div >
@@ -526,9 +526,7 @@ const TableContent = <
526526 >
527527 { loading && ! visibleColumns . length ? (
528528 < div className = "flexbox py-12 dc__gap-16" >
529- { isBulkSelectionConfigured || rowStartIconConfig || isAnyRowExpandable ? (
530- < div className = "shimmer w-20" />
531- ) : null }
529+ { showIconOrExpandActionGutter ? < div className = "shimmer w-20" /> : null }
532530 { SHIMMER_DUMMY_ARRAY . map ( ( label ) => (
533531 < div key = { label } className = "shimmer w-200" />
534532 ) ) }
0 commit comments