// Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React, { useCallback, useEffect } from 'react'; import type { ConversationType } from '../../state/ducks/conversations'; import type { LocalizerType } from '../../types/Util'; import { isInSystemContacts } from '../../util/isInSystemContacts'; import { Avatar, AvatarSize } from '../Avatar'; import { Modal } from '../Modal'; import { UserText } from '../UserText'; import { SharedGroupNames } from '../SharedGroupNames'; import { About } from './About'; export type PropsType = Readonly<{ i18n: LocalizerType; onClose: () => void; }> & ExternalPropsType; export type ExternalPropsType = Readonly<{ conversation: ConversationType; isSignalConnection: boolean; toggleSignalConnectionsModal: () => void; updateSharedGroups: (id: string) => void; }>; export function AboutContactModal({ i18n, conversation, isSignalConnection, toggleSignalConnectionsModal, updateSharedGroups, onClose, }: PropsType): JSX.Element { useEffect(() => { // Kick off the expensive hydration of the current sharedGroupNames updateSharedGroups(conversation.id); }, [conversation.id, updateSharedGroups]); const onSignalConnectionClick = useCallback( (ev: React.MouseEvent) => { ev.preventDefault(); toggleSignalConnectionsModal(); }, [toggleSignalConnectionsModal] ); return (

{i18n('icu:AboutContactModal__title')}

{conversation.about ? (
) : null} {isSignalConnection ? (
) : null} {isInSystemContacts(conversation) ? (
{i18n('icu:AboutContactModal__system-contact', { name: conversation.firstName || conversation.title, })}
) : null} {conversation.phoneNumber ? (
) : null}
); }