X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/3120740061c64645fe8a2015c075add657563921..1f6bacd062a8ee17a6631fab64b890f2f6d335ab:/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 71e37f1f..bbea4434 100644
--- a/src/components/file-tree/file-tree-item.tsx
+++ b/src/components/file-tree/file-tree-item.tsx
@@ -4,7 +4,7 @@
 
 import * as React from "react";
 import { TreeItem } from "../tree/tree";
-import { ProjectIcon, MoreOptionsIcon } from "../icon/icon";
+import { ProjectIcon, MoreOptionsIcon, DefaultIcon, CollectionIcon } from "../icon/icon";
 import { Typography, IconButton, StyleRulesCallback, withStyles, WithStyles } from "@material-ui/core";
 import { formatFileSize } from "../../common/formatters";
 import { ListItemTextIcon } from "../list-item-text-icon/list-item-text-icon";
@@ -40,7 +40,7 @@ export const FileTreeItem = withStyles(fileTreeItemStyle)(
             const { classes, item } = this.props;
             return <div className={classes.root}>
                 <ListItemTextIcon
-                    icon={ProjectIcon}
+                    icon={getIcon(item)}
                     name={item.data.name} />
                 <div className={classes.spacer} />
                 <Typography
@@ -59,3 +59,14 @@ export const FileTreeItem = withStyles(fileTreeItemStyle)(
         }
     });
 
+const getIcon = (item: TreeItem<FileTreeData>) => {
+    switch(item.data.type){
+        case 'directory':
+            return ProjectIcon;
+        case 'file':
+            return CollectionIcon;
+        default:
+            return DefaultIcon;
+    }
+};
+
