// Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React, { FunctionComponent, ReactNode } from 'react'; import { ConversationType } from '../../state/ducks/conversations'; import { LocalizerType } from '../../types/Util'; import { assert } from '../../util/assert'; import { Avatar, AvatarSize } from '../Avatar'; import { ContactName } from './ContactName'; import { SharedGroupNames } from '../SharedGroupNames'; type PropsType = { children?: ReactNode; conversation: ConversationType; i18n: LocalizerType; onClick?: () => void; }; export const ContactSpoofingReviewDialogPerson: FunctionComponent = ({ children, conversation, i18n, onClick, }) => { assert( conversation.type === 'direct', ' expected a direct conversation' ); const contents = ( <>
{conversation.phoneNumber ? (
{conversation.phoneNumber}
) : null}
{children}
); if (onClick) { return ( ); } return (
{contents}
); };