// Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; import classNames from 'classnames'; import { ContactName, PropsType as ContactNameProps } from './ContactName'; import { MessageRequestActionsConfirmation, MessageRequestState, Props as MessageRequestActionsConfirmationProps, } from './MessageRequestActionsConfirmation'; import { Intl } from '../Intl'; import { LocalizerType } from '../../types/Util'; export type Props = { i18n: LocalizerType; firstName?: string; onAccept(): unknown; } & Omit & Pick< MessageRequestActionsConfirmationProps, 'conversationType' | 'onBlock' | 'onBlockAndDelete' | 'onDelete' >; export const MandatoryProfileSharingActions = ({ conversationType, firstName, i18n, name, onAccept, onBlock, onBlockAndDelete, onDelete, phoneNumber, profileName, title, }: Props): JSX.Element => { const [mrState, setMrState] = React.useState(MessageRequestState.default); return ( <> {mrState !== MessageRequestState.default ? ( { throw new Error( 'Should not be able to unblock from MandatoryProfileSharingActions' ); }} onDelete={onDelete} name={name} profileName={profileName} phoneNumber={phoneNumber} title={title} conversationType={conversationType} state={mrState} onChangeState={setMrState} /> ) : null}

), learnMore: ( {i18n('MessageRequests--learn-more')} ), }} />

); };