X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/ba9a587ab628caea44d923b34d285a29e83e3456..fb2234b444c735c11b38a291749f2e4703da7aec:/src/components/file-tree/file-tree-item.tsx

diff --git a/src/components/file-tree/file-tree-item.tsx b/src/components/file-tree/file-tree-item.tsx
index 0e8c92e2..b522637d 100644
--- a/src/components/file-tree/file-tree-item.tsx
+++ b/src/components/file-tree/file-tree-item.tsx
@@ -2,14 +2,13 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as React from "react";
+import React from "react";
 import { TreeItem } from "../tree/tree";
-import { ProjectIcon, MoreOptionsIcon, DefaultIcon, CollectionIcon } from "../icon/icon";
+import { DirectoryIcon, MoreOptionsIcon, DefaultIcon, FileIcon } from "../icon/icon";
 import { Typography, IconButton, StyleRulesCallback, withStyles, WithStyles, Tooltip } from '@material-ui/core';
-import { formatFileSize } from "~/common/formatters";
+import { formatFileSize } from "common/formatters";
 import { ListItemTextIcon } from "../list-item-text-icon/list-item-text-icon";
 import { FileTreeData } from "./file-tree-data";
-import { FileThumbnail } from '~/components/file-tree/file-thumbnail';
 
 type CssRules = "root" | "spacer" | "sizeInfo" | "button" | "moreOptions";
 
@@ -46,7 +45,7 @@ export const FileTreeItem = withStyles(fileTreeItemStyle)(
             return <>
                 <div className={classes.root}>
                     <ListItemTextIcon
-                        icon={getIcon(item)}
+                        icon={getIcon(item.data.type)}
                         name={item.data.name} />
                     <div className={classes.spacer} />
                     <Typography
@@ -54,13 +53,13 @@ export const FileTreeItem = withStyles(fileTreeItemStyle)(
                         variant="caption">{formatFileSize(item.data.size)}</Typography>
                     <Tooltip title="More options" disableFocusListener>
                         <IconButton
+                            data-cy='file-item-options-btn'
                             className={classes.button}
                             onClick={this.handleClick}>
                             <MoreOptionsIcon className={classes.moreOptions} />
                         </IconButton>
                     </Tooltip>
                 </div >
-                <FileThumbnail file={item.data} />
             </>;
         }
 
@@ -69,12 +68,12 @@ export const FileTreeItem = withStyles(fileTreeItemStyle)(
         }
     });
 
-const getIcon = (item: TreeItem<FileTreeData>) => {
-    switch (item.data.type) {
+export const getIcon = (type: string) => {
+    switch (type) {
         case 'directory':
-            return ProjectIcon;
+            return DirectoryIcon;
         case 'file':
-            return CollectionIcon;
+            return FileIcon;
         default:
             return DefaultIcon;
     }
