import { Module } from '@ringcentral-integration/commons/lib/di' ; import { RcUIModuleV2 } from '@ringcentral-integration/core' ; import { Deps , ForwardUIFunctions , ForwardUIProps , } from './ForwardUI.interface' ; @ Module ( { name : 'ForwardUI' , deps : [ 'Locale' , 'RouterInteraction' , 'ActiveCallControl' , 'RouterInteraction' , { dep : 'ForwardUIOptions' , optional : true } , ] , } ) export class ForwardUI extends RcUIModuleV2 < Deps > { constructor ( deps ) { super ( { deps , } ) ; } getUIProps ( { telephonySessionId , } ) { return { telephonySessionId , currentLocale : this . _deps . locale ?. currentLocale , } ; } getUIFunctions ( ) { const { activeCallControl , routerInteraction } = this . _deps ; return { async onForward ( phoneNumber , telephonySessionId ) { const result = await activeCallControl . forward ( phoneNumber , telephonySessionId ) ; if ( result ) { routerInteraction . goBack ( ) ; } } , onBackClick ( ) { routerInteraction . goBack ( ) ; } , } ; } }