// Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; import { LocalizerType } from '../../../types/Util'; import { ConfirmationModal } from '../../ConfirmationModal'; import { PanelRow } from './PanelRow'; import { PanelSection } from './PanelSection'; import { ConversationDetailsIcon } from './ConversationDetailsIcon'; export type Props = { conversationTitle: string; onBlockAndDelete: () => void; onDelete: () => void; i18n: LocalizerType; }; export const ConversationDetailsActions: React.ComponentType = ({ conversationTitle, onBlockAndDelete, onDelete, i18n, }) => { const [confirmingLeave, setConfirmingLeave] = React.useState(false); const [confirmingBlock, setConfirmingBlock] = React.useState(false); return ( <> setConfirmingLeave(true)} icon={ } label={
{i18n('ConversationDetailsActions--leave-group')}
} /> setConfirmingBlock(true)} icon={ } label={
{i18n('ConversationDetailsActions--block-group')}
} />
{confirmingLeave && ( setConfirmingLeave(false)} title={i18n('ConversationDetailsActions--leave-group-modal-title')} > {i18n('ConversationDetailsActions--leave-group-modal-content')} )} {confirmingBlock && ( setConfirmingBlock(false)} title={i18n('ConversationDetailsActions--block-group-modal-title', [ conversationTitle, ])} > {i18n('ConversationDetailsActions--block-group-modal-content')} )} ); };