import clsx from 'clsx'; // @ts-expect-error TS(7016): Could not find a declaration file for module 'rc-t... Remove this comment to see the full error message import Tooltip from 'rc-tooltip'; import 'rc-tooltip/assets/bootstrap_white.css'; import React, { Component } from 'react'; import AnswerIcon from '../../assets/images/Answer.svg'; import ForwardIcon from '../../assets/images/Forward.svg'; import IgnoreIcon from '../../assets/images/Ignore.svg'; import MessageIcon from '../../assets/images/MessageFill.svg'; import VoicemailIcon from '../../assets/images/Voicemail.svg'; import ActiveCallButton from '../ActiveCallButton'; import ForwardForm from '../ForwardForm'; import MultiCallAnswerButton from '../MultiCallAnswerButton'; import ReplyWithMessage from '../ReplyWithMessage'; import i18n from './i18n'; import styles from './styles.scss'; const TooltipCom = typeof Tooltip === 'function' ? Tooltip : Tooltip.default; type IncomingCallPadProps = { answer: (...args: any[]) => any; reject: (...args: any[]) => any; toVoiceMail: (...args: any[]) => any; currentLocale: string; forwardingNumbers: any[]; formatPhone?: (...args: any[]) => any; onForward: (...args: any[]) => any; replyWithMessage: (...args: any[]) => any; className?: string; answerAndEnd?: (...args: any[]) => any; answerAndHold?: (...args: any[]) => any; hasOtherActiveCall?: boolean; sessionId: string; searchContactList: any[]; searchContact: (...args: any[]) => any; phoneTypeRenderer?: (...args: any[]) => any; phoneSourceNameRenderer?: (...args: any[]) => any; }; type IncomingCallPadState = { showForward: boolean; replyMessage: null; showReplyWithMessage: boolean; toVoiceMailEnabled: boolean; replyMessageEnabled: boolean; }; class IncomingCallPad extends Component< IncomingCallPadProps, IncomingCallPadState > { closeForwardForm: any; closeReplyWithMessage: any; forwardContainner: any; onReplyMessageChange: any; onShowForwardChange: any; onShowReplyWithMessageChange: any; replyTimeout: any; replyWithMessage: any; replyWithMessageContainner: any; toVoiceMail: any; voicemailTimeout: any; constructor(props: any) { super(props); this.state = { showForward: false, replyMessage: null, showReplyWithMessage: false, toVoiceMailEnabled: true, replyMessageEnabled: true, }; this.onShowForwardChange = (visible: any) => { this.setState({ showForward: visible, }); }; this.closeForwardForm = () => { this.onShowForwardChange(false); }; this.onShowReplyWithMessageChange = (visible: any) => { this.setState({ showReplyWithMessage: visible, }); }; this.onReplyMessageChange = (message: any) => { this.setState({ replyMessage: message }); }; this.closeReplyWithMessage = () => { this.onShowReplyWithMessageChange(false); }; this.toVoiceMail = () => { this.props.toVoiceMail(); // @ts-expect-error TS(2774): This condition will always return true since this ... Remove this comment to see the full error message if (this.props.toVoiceMail) { this.setState({ toVoiceMailEnabled: false, }); this.voicemailTimeout = setTimeout(() => { this.props.reject(); }, 3000); } }; this.replyWithMessage = (value: any) => { this.props.replyWithMessage(value); // @ts-expect-error TS(2774): This condition will always return true since this ... Remove this comment to see the full error message if (this.props.replyWithMessage) { this.setState({ replyMessageEnabled: false, }); this.replyTimeout = setTimeout(() => { this.props.reject(); }, 3000); } }; } // @ts-expect-error TS(4114): This member must have an 'override' modifier becau... Remove this comment to see the full error message UNSAFE_componentWillReceiveProps(newProps: any) { if (this.props.sessionId !== newProps.sessionId) { if (this.replyTimeout) { clearTimeout(this.replyTimeout); this.replyTimeout = null; } if (this.voicemailTimeout) { clearTimeout(this.voicemailTimeout); this.voicemailTimeout = null; } } } // @ts-expect-error TS(4114): This member must have an 'override' modifier becau... Remove this comment to see the full error message componentWillUnmount() { if (this.replyTimeout) { clearTimeout(this.replyTimeout); this.replyTimeout = null; } if (this.voicemailTimeout) { clearTimeout(this.voicemailTimeout); this.voicemailTimeout = null; } } // @ts-expect-error TS(4114): This member must have an 'override' modifier becau... Remove this comment to see the full error message render() { const { currentLocale, reject, answer, forwardingNumbers, formatPhone, className, hasOtherActiveCall, answerAndEnd, answerAndHold, } = this.props; // const isMultiCall = true; const multiCallButtons = (
any) | undefined' is no... Remove this comment to see the full error message onClick={answerAndEnd} title={i18n.getString('answerAndEnd', currentLocale)} dataSign="answerAndEnd" className={styles.callButton} isEndOtherCall /> any) | undefined' is no... Remove this comment to see the full error message onClick={answerAndHold} title={i18n.getString('answerAndHold', currentLocale)} dataSign="answerAndHold" className={styles.callButton} isEndOtherCall={false} />
); const singleCallButtons = (
); return (
{ this.forwardContainner = containner; }} />
{ this.replyWithMessageContainner = containner; }} />
} getTooltipContainer={() => this.forwardContainner} overlay={ } > null} title={i18n.getString('forward', currentLocale)} dataSign="forward" className={styles.callButton} /> } getTooltipContainer={() => this.replyWithMessageContainner} overlay={ } > null} icon={MessageIcon} title={i18n.getString('reply', currentLocale)} dataSign="reply" className={styles.callButton} />
{hasOtherActiveCall ? multiCallButtons : singleCallButtons}
); } } // @ts-expect-error TS(2339): Property 'defaultProps' does not exist on type 'ty... Remove this comment to see the full error message IncomingCallPad.defaultProps = { formatPhone: (phone: any) => phone, className: null, answerAndEnd: () => null, answerAndHold: () => null, hasOtherActiveCall: false, phoneTypeRenderer: undefined, phoneSourceNameRenderer: undefined, }; export default IncomingCallPad;