import type { LastCallInfo } from '@ringcentral-integration/commons/modules/ConferenceCall'; import React from 'react'; import callCtrlLayouts from '../../enums/callCtrlLayouts'; import ActiveCallPad from '../ActiveCallPad'; import BackButton from '../BackButton'; import BackHeader from '../BackHeader'; import { DurationCounter } from '../DurationCounter'; import Panel from '../Panel'; import CallInfo from './CallInfo'; import ConferenceInfo from './ConferenceInfo'; import MergeInfo from './MergeInfo'; import styles from './styles.scss'; type ActiveCallPanelProps = { phoneNumber?: string; nameMatches: { name: string }[]; fallBackName: string; currentLocale: string; startTime?: number; startTimeOffset?: number; isOnMute?: boolean; isOnHold?: boolean; recordStatus: string; onMute: (...args: any[]) => any; onUnmute: (...args: any[]) => any; onHold: (...args: any[]) => any; onUnhold: (...args: any[]) => any; onRecord: (...args: any[]) => any; onStopRecord: (...args: any[]) => any; onAdd?: (...args: any[]) => any; onMerge?: (...args: any[]) => any; onHangup: (...args: any[]) => any; showBackButton?: boolean; backButtonLabel?: string; onBackButtonClick?: (...args: any[]) => any; onShowKeyPad: (...args: any[]) => any; formatPhone: (...args: any[]) => any; areaCode: string; countryCode: string; selectedMatcherIndex: number; onSelectMatcherName: (...args: any[]) => any; avatarUrl?: string; brand?: string; showContactDisplayPlaceholder?: boolean; onFlip?: (...args: any[]) => any; disableFlip?: boolean; onPark?: (...args: any[]) => any; showPark?: boolean; gotoParticipantsCtrl?: (...args: any[]) => any; sourceIcons?: object; phoneTypeRenderer?: (...args: any[]) => any; phoneSourceNameRenderer?: (...args: any[]) => any; layout: string; direction?: string; addDisabled?: boolean; mergeDisabled?: boolean; conferenceCallParties?: any[]; conferenceCallEquipped?: boolean; hasConferenceCall?: boolean; lastCallInfo?: LastCallInfo; getAvatarUrl?: (...args: any[]) => any; actions?: any[]; controlBusy?: boolean; callQueueName?: string; isOnWaitingTransfer?: boolean; onCompleteTransfer?: (...args: any[]) => any; isOnTransfer?: boolean; showCallerIdName?: boolean; callerIdName?: string; }; const ActiveCallPanel: React.FC = ({ showBackButton, backButtonLabel, onBackButtonClick, currentLocale, nameMatches, fallBackName, phoneNumber, formatPhone, startTime, startTimeOffset, areaCode, countryCode, selectedMatcherIndex, onSelectMatcherName, avatarUrl, isOnMute, isOnHold, recordStatus, onMute, onUnmute, onHold, onUnhold, onRecord, onStopRecord, onShowKeyPad, onHangup, onPark, onAdd, onMerge, onFlip, // @ts-expect-error TS(2339): Property 'onTransfer' does not exist on type 'Prop... Remove this comment to see the full error message onTransfer, gotoParticipantsCtrl, children, showContactDisplayPlaceholder, brand, disableFlip, showPark, sourceIcons, phoneTypeRenderer, phoneSourceNameRenderer, layout, direction, addDisabled, mergeDisabled, conferenceCallEquipped, hasConferenceCall, conferenceCallParties, lastCallInfo, getAvatarUrl, actions, controlBusy, showCallerIdName, callerIdName, callQueueName, isOnTransfer, isOnWaitingTransfer, onCompleteTransfer, }) => { const backHeader = showBackButton ? ( } /> ) : null; const timeCounter = (
{startTime ? ( ) : ( )}
); const currentCallTitle = nameMatches?.length ? nameMatches[0].name : formatPhone(phoneNumber); let callInfo; switch (layout) { case callCtrlLayouts.completeTransferCtrl: case callCtrlLayouts.mergeCtrl: callInfo = ( ); break; case callCtrlLayouts.conferenceCtrl: callInfo = ( ); break; default: callInfo = ( ); break; } const showTimeCounter = layout !== callCtrlLayouts.mergeCtrl && layout !== callCtrlLayouts.completeTransferCtrl; return (
{backHeader} {showTimeCounter ? timeCounter : null} {callInfo} any) | undefined' is no... Remove this comment to see the full error message onFlip={onFlip} disableFlip={disableFlip} // @ts-expect-error TS(2322): Type '((...args: any[]) => any) | undefined' is no... Remove this comment to see the full error message onPark={onPark} showPark={showPark} layout={layout} direction={direction} addDisabled={addDisabled} mergeDisabled={mergeDisabled} conferenceCallEquipped={conferenceCallEquipped} hasConferenceCall={hasConferenceCall} actions={actions} controlBusy={controlBusy} isOnTransfer={isOnTransfer} isOnWaitingTransfer={isOnWaitingTransfer} // @ts-expect-error TS(2322): Type '((...args: any[]) => any) | undefined' is no... Remove this comment to see the full error message onCompleteTransfer={onCompleteTransfer} /> {children}
); }; ActiveCallPanel.defaultProps = { // @ts-expect-error TS(2322): Type 'null' is not assignable to type 'number | un... Remove this comment to see the full error message startTime: null, startTimeOffset: 0, isOnMute: false, isOnHold: false, // @ts-expect-error TS(2322): Type 'null' is not assignable to type 'string | un... Remove this comment to see the full error message phoneNumber: null, children: undefined, // @ts-expect-error TS(2322): Type 'null' is not assignable to type 'string | un... Remove this comment to see the full error message avatarUrl: null, showBackButton: false, backButtonLabel: 'Active Calls', // @ts-expect-error TS(2322): Type 'null' is not assignable to type '((...args: ... Remove this comment to see the full error message onBackButtonClick: null, brand: 'RingCentral', showContactDisplayPlaceholder: true, disableFlip: false, showPark: false, onAdd: undefined, onMerge: undefined, onFlip: () => null, onPark: () => null, gotoParticipantsCtrl: () => null, onCompleteTransfer: () => null, sourceIcons: undefined, phoneTypeRenderer: undefined, phoneSourceNameRenderer: undefined, // @ts-expect-error TS(2322): Type 'null' is not assignable to type 'string | un... Remove this comment to see the full error message direction: null, addDisabled: false, mergeDisabled: false, conferenceCallEquipped: false, hasConferenceCall: false, conferenceCallParties: undefined, lastCallInfo: undefined, getAvatarUrl: () => null, actions: [], controlBusy: false, callerIdName: undefined, // @ts-expect-error TS(2322): Type 'null' is not assignable to type 'string | un... Remove this comment to see the full error message callQueueName: null, isOnWaitingTransfer: false, isOnTransfer: false, }; export default ActiveCallPanel;