diff --git a/webapp/channels/src/components/advanced_text_editor/voice_message_attachment/index.tsx b/webapp/channels/src/components/advanced_text_editor/voice_message_attachment/index.tsx index e49b4886d8..2d81f1cf45 100644 --- a/webapp/channels/src/components/advanced_text_editor/voice_message_attachment/index.tsx +++ b/webapp/channels/src/components/advanced_text_editor/voice_message_attachment/index.tsx @@ -186,6 +186,7 @@ const VoiceMessageAttachment = (props: Props) => { ); diff --git a/webapp/channels/src/components/voice/post_type/index.tsx b/webapp/channels/src/components/voice/post_type/index.tsx index 7c083b1666..0e0300d6dc 100644 --- a/webapp/channels/src/components/voice/post_type/index.tsx +++ b/webapp/channels/src/components/voice/post_type/index.tsx @@ -6,6 +6,7 @@ import { PauseIcon, DotsVerticalIcon, DownloadOutlineIcon, + CloseIcon, } from '@infomaniak/compass-icons/components'; import React, {useState, useEffect} from 'react'; import {FormattedMessage, useIntl} from 'react-intl'; @@ -28,6 +29,7 @@ export interface Props { post?: Post; isPreview?: boolean; fileId?: string; + onCancel?: () => void; } function VoiceMessageAttachmentPlayer(props: Props) { @@ -108,29 +110,31 @@ function VoiceMessageAttachmentPlayer(props: Props) { ); const transcriptHeader = ( -
- {toggle} + ((!props.isPreview && transcript?.text?.length !== 0 && transcript?.text?.length !== undefined) || (isLoading && !props.isPreview)) && (
-
- {props.isPreview ? null : ( - <> - {isLoading && !props.fileId ? ( - loadingMessage - ) : ( - transcriptReady - )} - - )} + {toggle} +
+
+ {props.isPreview ? null : ( + <> + {isLoading && !props.fileId ? ( + loadingMessage + ) : ( + transcriptReady + )} + + )} +
-
+ ) ); return ( @@ -208,6 +212,17 @@ function VoiceMessageAttachmentPlayer(props: Props) { /> )} + {props.isPreview && ( + + )}
@@ -248,8 +263,6 @@ function VoiceMessageAttachmentPlayer(props: Props) {
) } - - {/* {error &&
{error}
} */} );