import callDirections from '@ringcentral-integration/commons/enums/callDirections'; import telephonyStatuses from '@ringcentral-integration/commons/enums/telephonyStatus'; import { RcMenuItem, RcMenuList, RcPopover, useResultRef, } from '@ringcentral/juno'; import clsx from 'clsx'; import PropTypes from 'prop-types'; import React from 'react'; import dynamicsFont from '../../assets/DynamicsFont/DynamicsFont.scss'; import EndIcon from '../../assets/images/Hangup.svg'; import LogClickIcon from '../../assets/images/LogClick.svg'; import LogUnclickIcon from '../../assets/images/LogUnclick.svg'; import VoicemailRed from '../../assets/images/VoicemailRed.svg'; import { Button } from '../Button'; import i18n from './i18n'; import styles from './styles.scss'; const CallIcon = ({ title, iconClassName }: any) => ( ); CallIcon.propTypes = { title: PropTypes.string, iconClassName: PropTypes.string, }; CallIcon.defaultProps = { title: '', iconClassName: '', }; const callIconMap = { [callDirections.inbound]: dynamicsFont.inbound, [callDirections.outbound]: dynamicsFont.outbound, }; const LogNotification = ({ formatPhone, currentLog, currentLocale, showLogButton, isExpand, onDiscard, onSave, onExpand, currentSession, onReject, onHangup, showEndButton = true, shrinkNotification, showLogOptions = true, }: any) => { const anchorEl = React.useRef(null); const viewport = useResultRef(() => document.querySelector('div#viewport')); const renderEndButton = showEndButton && currentSession ? () => { const { callStatus, direction } = currentSession; const isInComingCall = callDirections.inbound === direction && telephonyStatuses.ringing === callStatus; const endTitle = isInComingCall ? i18n.getString('reject', currentLocale) : i18n.getString('hangup', currentLocale); const endAction = isInComingCall ? onReject : onHangup; const isRinging = telephonyStatuses.ringing === callStatus; return ( ); } : null; const renderLogButton = showLogButton ? () => { if (showLogOptions) { return ( <>
{logName}
{formatNumber}