@@ -350,14 +350,23 @@ const onTaskDeclined = (task,reason) => {
350350 } ) ;
351351 } ;
352352
353+ const formatWidgetName = ( widget : string ) => {
354+ switch ( widget ) {
355+ case 'callControlCAD' :
356+ return 'Call Controls with Call Associated Data (CAD)' ;
357+ default :
358+ return widget . charAt ( 0 ) . toUpperCase ( ) + widget . slice ( 1 ) . replace ( / ( [ A - Z ] ) / g, ' $1' ) ;
359+ }
360+ } ;
361+
353362 return (
354363 < div className = "app mds-typography" >
355364 < ThemeProvider
356365 themeclass = { currentTheme === 'LIGHT' ? 'mds-theme-stable-lightWebex' : 'mds-theme-stable-darkWebex' }
357366 >
358367 < IconProvider iconSet = "momentum-icons" >
359368 < div className = "webexTheme" >
360- < h1 > Contact Center widgets in a react app</ h1 >
369+ < h1 > Contact Center Widgets in a React app</ h1 >
361370 { showLoader && (
362371 < div className = "profile-loader-overlay" >
363372 < div className = "profile-loader-spinner" aria-label = "Loading" />
@@ -451,7 +460,7 @@ const onTaskDeclined = (task,reason) => {
451460 data-testid = { `samples:widget-${ widget } ` }
452461 />
453462
454- { widget . charAt ( 0 ) . toUpperCase ( ) + widget . slice ( 1 ) . replace ( / ( [ A - Z ] ) / g , ' $1' ) }
463+ { formatWidgetName ( widget ) }
455464 { widget === 'outdialCall' && (
456465 < span style = { { display : 'inline-flex' , alignItems : 'center' } } >
457466 < PopoverNext
@@ -567,8 +576,10 @@ const onTaskDeclined = (task,reason) => {
567576 < Button
568577 disabled = { accessToken . trim ( ) === '' }
569578 onClick = { ( ) => {
579+ setShowLoader ( true ) ;
570580 store . init ( { webexConfig, access_token : accessToken } ) . then ( ( ) => {
571581 setIsSdkReady ( true ) ;
582+ setShowLoader ( false ) ;
572583 } ) ;
573584 } }
574585 data-testid = "samples:init-widgets-button"
@@ -707,7 +718,7 @@ const onTaskDeclined = (task,reason) => {
707718 < div className = "box" >
708719 < section className = "section-box" >
709720 < fieldset className = "fieldset" >
710- < legend className = "legend-box" > Call Control CAD</ legend >
721+ < legend className = "legend-box" > Call Control with Call Associated Data ( CAD) </ legend >
711722 < CallControlCAD
712723 onHoldResume = { onHoldResume }
713724 onEnd = { onEnd }
0 commit comments