// Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; import type { PropsType as ContactNameProps } from './ContactName'; import { ContactName } from './ContactName'; import { Button, ButtonVariant } from '../Button'; import type { Props as MessageRequestActionsConfirmationProps } from './MessageRequestActionsConfirmation'; import { MessageRequestActionsConfirmation, MessageRequestState, } from './MessageRequestActionsConfirmation'; import { Intl } from '../Intl'; import type { LocalizerType } from '../../types/Util'; export type Props = { i18n: LocalizerType; isHidden?: boolean; } & Omit & Omit< MessageRequestActionsConfirmationProps, 'i18n' | 'state' | 'onChangeState' >; export function MessageRequestActions({ acceptConversation, blockAndReportSpam, blockConversation, conversationId, conversationType, deleteConversation, firstName, i18n, isHidden, isBlocked, title, }: Props): JSX.Element { const [mrState, setMrState] = React.useState(MessageRequestState.default); const name = ( ); let message: JSX.Element | undefined; if (conversationType === 'direct') { if (isBlocked) { message = ( ); } else if (isHidden) { message = ( ); } else { message = ( ); } } else if (conversationType === 'group') { if (isBlocked) { message = ( ); } else { message = ; } } return ( <> {mrState !== MessageRequestState.default ? ( ) : null}

{message}

{isBlocked ? ( ) : ( )} {!isBlocked ? ( ) : null}
); }