import { px, RcIconButton } from '@ringcentral/juno'; import { ChevronLeft as chevronLeftSvg, ChevronRight as chevronRight, } from '@ringcentral/juno-icon'; import clsx from 'clsx'; import type { FunctionComponent, MutableRefObject } from 'react'; import React, { useEffect, useState } from 'react'; import { AnimationPanel } from '../AnimationPanel'; import type { ShinyBarProps } from '../LogBasicInfoV2/ShinyBar'; import { ShinyBar } from '../LogBasicInfoV2/ShinyBar'; import type { BasicCallInfoMainProps } from './BasicCallInfoMain'; import { BasicCallInfoMain } from './BasicCallInfoMain'; import type { CallInfoProps } from './CallInfo'; import { CallInfoList } from './CallInfoList'; import styles from './styles.scss'; export type BasicCallInfoProps = { currentLocale: string; isRinging: boolean; callInfos?: CallInfoProps[]; callControlRef?: MutableRefObject; classes?: { panel?: string }; onCopySuccess?: (name: string) => void; } & Pick & Pick; export const KeyPadHeight = 32; export const SubmitButtonHeight = 60; export const BasicCallInfo: FunctionComponent = ({ subject, isInbound, isRinging, followInfos, callInfos, // @ts-expect-error TS(2339): Property 'panel' does not exist on type '{ panel?:... Remove this comment to see the full error message classes: { panel: panelClass }, status, callControlRef, onCopySuccess, currentLocale, }) => { const [open, setOpen] = useState(false); const [panelHeight, setPanelHeight] = useState('100%'); const toggleOpen = () => setOpen(!open); useEffect(() => { if (callControlRef?.current) { setPanelHeight( `calc(100% - ${px( callControlRef.current.clientHeight + KeyPadHeight, )})`, ); } if (status === 'callEnd') { setPanelHeight(`calc(100% - ${px(SubmitButtonHeight)})`); } }, [status, callControlRef]); // when ringing state change, close that info view useEffect(() => { if (open && !isRinging) { toggleOpen(); } // eslint-disable-next-line react-hooks/exhaustive-deps }, [isRinging]); return ( <>
); }; BasicCallInfo.defaultProps = { classes: {}, };