import type { FunctionComponent } from 'react'; import React from 'react'; import { phoneSources } from '../../enums/phoneSources'; import phoneSourceNames from '../../lib/phoneSourceNames'; import type { RecipientInfoProps } from './RecipientsInputV2.interface'; import styles from './styles.scss'; export const RecipientInfo: FunctionComponent = ({ currentLocale, name, entityType, enableTitle, phoneSourceNameRenderer, splitter, }) => { // align the type in contact search result so far temporarily, // need pass brand info here if need to use phoneSources.rcContact. // see also ringcentral-js-widgets/ringcentral-widgets/components/ContactDropdownList/ContactInfo.tsx const type = entityType === phoneSources.rcContact ? phoneSources.contact : entityType; const phoneSourceName = phoneSourceNameRenderer ? // @ts-expect-error TS(2345): Argument of type 'string | undefined' is not assig... Remove this comment to see the full error message phoneSourceNameRenderer(type) : // @ts-expect-error TS(2345): Argument of type 'string | undefined' is not assig... Remove this comment to see the full error message phoneSourceNames.getString(type, currentLocale); const title = enableTitle ? `${name} ${splitter} ${phoneSourceName}` : undefined; return (
{name} {splitter} {phoneSourceName}
); };