// Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import classNames from 'classnames'; import React from 'react'; import type { ShowToastAction } from '../../state/ducks/toast'; import { ToastType } from '../../types/Toast'; import type { LocalizerType } from '../../types/Util'; // Keep this in sync with iOS and Android const MAX_FORWARD_COUNT = 30; type SelectModeActionsProps = Readonly<{ selectedMessageIds: ReadonlyArray; onExitSelectMode: () => void; onDeleteMessages: () => void; onForwardMessages: () => void; showToast: ShowToastAction; i18n: LocalizerType; }>; export default function SelectModeActions({ selectedMessageIds, onExitSelectMode, onDeleteMessages, onForwardMessages, showToast, i18n, }: SelectModeActionsProps): JSX.Element { const hasSelectedMessages = selectedMessageIds.length >= 1; const tooManyMessagesToForward = selectedMessageIds.length > MAX_FORWARD_COUNT; const canForward = hasSelectedMessages && !tooManyMessagesToForward; const canDelete = hasSelectedMessages; return (
{i18n('icu:SelectModeActions--selectedMessages', { count: selectedMessageIds.length, })}
); }