diff --git a/src/components/media/media.tsx b/src/components/media/media.tsx
index cdffeb1a..79fbb8fc 100644
--- a/src/components/media/media.tsx
+++ b/src/components/media/media.tsx
@@ -1,4 +1,4 @@
-import React, { useState } from 'react';
+import React from 'react';
import styles from './media.module.css';
import { CommentMediaInfo } from '../../lib/utils/media-utils';
import useFetchGifFirstFrame from '../../hooks/use-fetch-gif-first-frame';
@@ -34,7 +34,7 @@ const ThumbnailSmall = ({ style, children, thumbnailSmallPadding }: ThumbnailPro
);
-const Thumbnail = ({ commentMediaInfo, isMobile, isReply, linkHeight, linkWidth }: MediaProps) => {
+const Thumbnail = ({ commentMediaInfo, isMobile, isReply, linkHeight, linkWidth, setShowThumbnail }: MediaProps) => {
let displayWidth, displayHeight;
const maxThumbnailSize = isMobile || isReply ? 125 : 250;
if (linkWidth && linkHeight) {
@@ -46,19 +46,30 @@ const Thumbnail = ({ commentMediaInfo, isMobile, isReply, linkHeight, linkWidth
displayHeight = `${maxThumbnailSize}px`;
}
+ if (commentMediaInfo?.type === 'audio') {
+ displayWidth = '250px';
+ displayHeight = '75px';
+ }
+
let mediaComponent: React.ReactNode = null;
const iframeThumbnail = commentMediaInfo?.patternThumbnailUrl || commentMediaInfo?.thumbnail;
const gifFrameUrl = useFetchGifFirstFrame(commentMediaInfo?.type === 'gif' ? commentMediaInfo.url : undefined);
if (commentMediaInfo?.type === 'image') {
- mediaComponent =
;
+ mediaComponent =
setShowThumbnail(false)} />;
} else if (commentMediaInfo?.type === 'video') {
- mediaComponent = commentMediaInfo.thumbnail ?
: ;
+ mediaComponent = commentMediaInfo.thumbnail ? (
+
+ ) : (
+