X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/dbd2dcaeb2c4f3f3df83c3d127e99ce4705a4723..8aefbd08c053d9cba911bdd107524c318125034f:/src/views-components/details-panel/file-details.tsx

diff --git a/src/views-components/details-panel/file-details.tsx b/src/views-components/details-panel/file-details.tsx
index 7d43bd4b3b..db7c9cfe0f 100644
--- a/src/views-components/details-panel/file-details.tsx
+++ b/src/views-components/details-panel/file-details.tsx
@@ -9,6 +9,7 @@ import { getIcon } from '~/components/file-tree/file-tree-item';
 import { DetailsAttribute } from '~/components/details-attribute/details-attribute';
 import { formatFileSize } from '~/common/formatters';
 import { FileThumbnail } from '~/components/file-tree/file-thumbnail';
+import isImage from 'is-image';
 
 export class FileDetails extends DetailsData<CollectionFile | CollectionDirectory> {
 
@@ -22,8 +23,12 @@ export class FileDetails extends DetailsData<CollectionFile | CollectionDirector
         return item.type === CollectionFileType.FILE
             ? <>
                 <DetailsAttribute label='Size' value={formatFileSize(item.size)} />
-                <DetailsAttribute label='Preview' />
-                <FileThumbnail file={item}/>
+                {
+                    isImage(item.url) && <>
+                        <DetailsAttribute label='Preview' />
+                        <FileThumbnail file={item} />
+                    </>
+                }
             </>
             : <div />;
     }
