// Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; import type { LocalizerType } from '../types/Util'; import { Modal } from './Modal'; import { Button, ButtonVariant } from './Button'; export type PropsType = { i18n: LocalizerType; modalType: AttachmentNotAvailableModalType; onClose: () => void; }; export enum AttachmentNotAvailableModalType { File = 'File', LongText = 'LongText', Sticker = 'Sticker', VisualMedia = 'VisualMedia', VoiceMessage = 'VoiceMessage', } function focusRef(el: HTMLElement | null) { if (el) { el.focus(); } } function getTitle( i18n: LocalizerType, modalType: AttachmentNotAvailableModalType ): string { switch (modalType) { case AttachmentNotAvailableModalType.LongText: return i18n('icu:AttachmentNotAvailableModal__title--long-text'); case AttachmentNotAvailableModalType.Sticker: return i18n('icu:AttachmentNotAvailableModal__title--sticker'); case AttachmentNotAvailableModalType.VisualMedia: return i18n('icu:AttachmentNotAvailableModal__title--media'); case AttachmentNotAvailableModalType.VoiceMessage: return i18n('icu:AttachmentNotAvailableModal__title--voice-message'); case AttachmentNotAvailableModalType.File: default: return i18n('icu:AttachmentNotAvailableModal__title--file'); } } function getBody( i18n: LocalizerType, modalType: AttachmentNotAvailableModalType ): string { switch (modalType) { case AttachmentNotAvailableModalType.LongText: return i18n('icu:AttachmentNotAvailableModal__body--long-text'); case AttachmentNotAvailableModalType.Sticker: return i18n('icu:AttachmentNotAvailableModal__body--sticker'); case AttachmentNotAvailableModalType.VisualMedia: return i18n('icu:AttachmentNotAvailableModal__body--media'); case AttachmentNotAvailableModalType.VoiceMessage: return i18n('icu:AttachmentNotAvailableModal__body--voice-message'); case AttachmentNotAvailableModalType.File: default: return i18n('icu:AttachmentNotAvailableModal__body--file'); } } export function AttachmentNotAvailableModal(props: PropsType): JSX.Element { const { i18n, modalType, onClose } = props; const footer = ( ); return (
{getBody(i18n, modalType)}
); }