import { RcList, RcListItem } from '@ringcentral/juno'; import clsx from 'clsx'; import type { FunctionComponent } from 'react'; import React from 'react'; import copyButton from '../../CopyButton/CopyButton'; import CopyToClipboard from '../../CopyToClipboard'; import type { CallInfoProps } from '../CallInfo'; import { CallInfo } from '../CallInfo'; import styles from './styles.scss'; export interface CallInfoListProps { callInfos?: Array; className?: string; onCopySuccess?: (name: string) => void; currentLocale?: string; } export const CallInfoList: FunctionComponent = ({ callInfos, className, onCopySuccess, currentLocale, }) => { if (!callInfos || callInfos.length === 0) return null; return (
{callInfos.map(({ attr, name, content, enableCopy }, i) => ( {enableCopy && (
onCopySuccess(attr)} // @ts-expect-error TS(2769): No overload matches this call. currentLocale={currentLocale} button={copyButton} copiedText={content} />
)}
))}
); };