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