X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/701e59342c16c23f8ee16c1ef92ee2ca6c416c0a..5a2f4597393f94b9fa7984f4445d4b599c139f27:/src/views-components/context-menu/actions/file-viewer-actions.tsx

diff --git a/src/views-components/context-menu/actions/file-viewer-actions.tsx b/src/views-components/context-menu/actions/file-viewer-actions.tsx
index 868769d9..6d713d55 100644
--- a/src/views-components/context-menu/actions/file-viewer-actions.tsx
+++ b/src/views-components/context-menu/actions/file-viewer-actions.tsx
@@ -2,14 +2,15 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as React from "react";
-import { ListItemText, ListItem, ListItemIcon } from "@material-ui/core";
-import { RootState } from '~/store/store';
-import { getNodeValue } from '~/models/tree';
-import { CollectionDirectory, CollectionFile, CollectionFileType } from '~/models/collection-file';
-import { FileViewerList, FileViewer } from '~/models/file-viewers-config';
-import { getFileViewers } from '~/store/file-viewers/file-viewers-selectors';
+import React from "react";
+import { ListItemText, ListItem, ListItemIcon, Icon } from "@material-ui/core";
+import { RootState } from 'store/store';
+import { getNodeValue } from 'models/tree';
+import { CollectionDirectory, CollectionFile, CollectionFileType } from 'models/collection-file';
+import { FileViewerList, FileViewer } from 'models/file-viewers-config';
+import { getFileViewers } from 'store/file-viewers/file-viewers-selectors';
 import { connect } from 'react-redux';
+import { OpenIcon } from 'components/icon/icon';
 
 interface FileViewerActionProps {
     fileUrl: string;
@@ -55,17 +56,26 @@ export const FileViewerActions = connect(mapStateToProps)(
     ({ fileUrl, viewers, onClick }: FileViewerActionProps & { onClick: () => void }) =>
         <>
             {viewers.map(viewer =>
-                <a
+                <ListItem
+                    button
+                    component='a'
                     key={viewer.name}
                     style={{ textDecoration: 'none' }}
                     href={fillViewerUrl(fileUrl, viewer)}
                     onClick={onClick}
                     target='_blank'>
-                    <ListItem button>
-                        <ListItemText>
-                            {viewer.name}
-                        </ListItemText>
-                    </ListItem>
-                </a>
+                    <ListItemIcon>
+                        {
+                            viewer.iconUrl
+                                ? <Icon>
+                                    <img src={viewer.iconUrl} />
+                                </Icon>
+                                : <OpenIcon />
+                        }
+                    </ListItemIcon>
+                    <ListItemText>
+                        {viewer.name}
+                    </ListItemText>
+                </ListItem>
             )}
         </>);
