import { RcMenuItem, RcMenuList, RcPopover, RcText } from '@ringcentral/juno'; import { Ignore as IgnoreIcon, ArrowRight, Forwardcall, Forwarding as ReplyIcon, } from '@ringcentral/juno-icon'; import clsx from 'clsx'; import type { FunctionComponent } from 'react'; import React, { useState } from 'react'; import MoreIcon from '../../../assets/images/MoreIcon.svg'; import { CircleButtonWithTitle } from '../../CircleButton'; import i18n from '../i18n'; import rootStyles from '../styles.scss'; import type { MoreActionWithIncomingCallProps } from './MoreActionWithIncomingCall.interface'; import { StyledArrowIcon, StyledActionIcon, StyledMenuList, StyledReplyIcon, } from './StyledMoreAction'; import styles from './styles.scss'; const MoreActionWithIncomingCall: FunctionComponent< MoreActionWithIncomingCallProps > = (props) => { const { disabled, currentLocale, forwardingNumbers, forward, ignore, reply, clickForwardTrack, enableReply, isWebRTCNotification = false, disableIgnore, } = props; const [anchorEl, setAnchorEl] = useState(null); const [forwardListEl, setForwardListEl] = useState(null); const handleClick = (event: React.MouseEvent) => { // @ts-expect-error TS(2345): Argument of type 'EventTarget & HTMLButtonElement'... Remove this comment to see the full error message setAnchorEl(event.currentTarget); }; const handleClose = () => { setAnchorEl(null); }; const handleForwardListClick = ( event: React.MouseEvent, ) => { clickForwardTrack(); // @ts-expect-error TS(2345): Argument of type 'Element' is not assignable to pa... Remove this comment to see the full error message setForwardListEl(event.currentTarget.children?.[0]); }; const handleForwardListClose = () => { setForwardListEl(null); }; const onForward = (event: React.MouseEvent) => { // @ts-expect-error TS(7015): Element implicitly has an 'any' type because index... Remove this comment to see the full error message const selectedValue = event.currentTarget.attributes['data-value'].value; if (selectedValue === 'custom') { setForwardListEl(null); setAnchorEl(null); } forward(selectedValue); }; const title = i18n.getString('more', currentLocale); return ( <> )... Remove this comment to see the full error message onClick={handleForwardListClick} data-sign="forward" > {i18n.getString('forward', currentLocale)} {enableReply && ( { handleClose(); reply?.(); }} data-sign="reply" > {i18n.getString('reply', currentLocale)} )} {ignore && ( {i18n.getString('ignore', currentLocale)} )} {[ ...forwardingNumbers, { phoneNumber: 'custom', label: i18n.getString('custom', currentLocale), }, ].map((item) => { const isCustomOption = item.phoneNumber === 'custom'; return ( )... Remove this comment to see the full error message onClick={onForward} key={item.phoneNumber} data-value={item.phoneNumber} data-sign={item.phoneNumber} >
{item.label} {isCustomOption ? ( ) : ( {item.phoneNumber} )}
); })}
); }; export { MoreActionWithIncomingCall };