@@ -269,7 +269,7 @@ function createConsentManagement<
269269
270270 const [ isProcessingChanges , setIsProcessingChanges ] = useState ( false ) ;
271271
272- const createOnAcceptOrRefuseAll =
272+ const createButtonCallback =
273273 ( type : "grantAll" | "denyAll" | "apply local changes" ) => async ( ) => {
274274 setIsProcessingChanges ( true ) ;
275275
@@ -310,7 +310,7 @@ function createConsentManagement<
310310 < button
311311 title = { t ( "accept all - title" ) }
312312 className = { fr . cx ( "fr-btn" ) }
313- onClick = { createOnAcceptOrRefuseAll ( "grantAll" ) }
313+ onClick = { createButtonCallback ( "grantAll" ) }
314314 disabled = { isProcessingChanges }
315315 >
316316 { t ( "accept all" ) }
@@ -319,7 +319,7 @@ function createConsentManagement<
319319 title = { t ( "refuse all - title" ) }
320320 className = { fr . cx ( "fr-btn" , "fr-btn--secondary" ) }
321321 disabled = { isProcessingChanges }
322- onClick = { createOnAcceptOrRefuseAll ( "denyAll" ) }
322+ onClick = { createButtonCallback ( "denyAll" ) }
323323 >
324324 { t ( "refuse all" ) }
325325 </ button >
@@ -407,7 +407,11 @@ function createConsentManagement<
407407 ) }
408408 >
409409 < li >
410- < button className = { fr . cx ( "fr-btn" ) } disabled = { isProcessingChanges } >
410+ < button
411+ className = { fr . cx ( "fr-btn" ) }
412+ disabled = { isProcessingChanges }
413+ onClick = { createButtonCallback ( "apply local changes" ) }
414+ >
411415 Confirmer mes choix
412416 </ button >
413417 </ li >
0 commit comments