99 store ,
1010 OutdialCall ,
1111} from '@webex/cc-widgets' ;
12+ import { StationLogoutSuccess } from '@webex/plugin-cc' ;
1213import Webex from 'webex/contact-center' ;
1314import { ThemeProvider , IconProvider , Icon , Button , Checkbox , Text , Select , Option } from '@momentum-design/components/dist/react' ;
1415import { PopoverNext } from '@momentum-ui/react-collaboration' ;
@@ -310,6 +311,16 @@ function App() {
310311 console . log ( 'onStateChange invoked' , status ) ;
311312 } ;
312313
314+ const stationLogout = ( ) => {
315+ store . cc . stationLogout ( { logoutReason : 'User requested logout' } )
316+ . then ( ( res : StationLogoutSuccess ) => {
317+ console . log ( 'Agent logged out successfully' , res . data . type ) ;
318+ } )
319+ . catch ( ( error : Error ) => {
320+ console . log ( 'Agent logout failed' , error ) ;
321+ } ) ;
322+ } ;
323+
313324 return (
314325 < div className = "app mds-typography" >
315326 < ThemeProvider
@@ -409,7 +420,7 @@ function App() {
409420 < div className = "box" style = { { flex : 1 } } >
410421 < section className = "section-box" >
411422 < fieldset className = "fieldset" >
412- < legend className = "legend-box" > Sample App Toggles </ legend >
423+ < legend className = "legend-box" > Sample App Toggles and Operations </ legend >
413424 < Checkbox
414425 checked = { currentTheme === 'DARK' }
415426 aria-label = "theme checkbox"
@@ -432,6 +443,11 @@ function App() {
432443 setShowAgentProfile ( ! showAgentProfile ) ;
433444 } }
434445 />
446+ { store . isAgentLoggedIn && (
447+ < Button id = "logoutAgent" onClick = { stationLogout } color = "positive" className = 'stationLogoutButtonClass' >
448+ Station Logout
449+ </ Button >
450+ ) }
435451 </ fieldset >
436452 </ section >
437453 < br />
0 commit comments