19007: Removes unused code from the old file browser.
[arvados-workbench2.git] / src / components / file-tree / file-tree-item.tsx
index b522637de0b261c2edf8eb3ce8d49d4fd634b92f..d94c7297e922d1150359cff84a82e05ef41186e7 100644 (file)
@@ -2,71 +2,7 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import React from "react";
-import { TreeItem } from "../tree/tree";
-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 { ListItemTextIcon } from "../list-item-text-icon/list-item-text-icon";
-import { FileTreeData } from "./file-tree-data";
-
-type CssRules = "root" | "spacer" | "sizeInfo" | "button" | "moreOptions";
-
-const fileTreeItemStyle: StyleRulesCallback<CssRules> = theme => ({
-    root: {
-        display: "flex",
-        alignItems: "center",
-        paddingRight: `${theme.spacing.unit * 1.5}px`
-    },
-    spacer: {
-        flex: "1"
-    },
-    sizeInfo: {
-        width: `${theme.spacing.unit * 8}px`
-    },
-    button: {
-        width: theme.spacing.unit * 3,
-        height: theme.spacing.unit * 3,
-        marginRight: theme.spacing.unit,
-    },
-    moreOptions: {
-        position: 'absolute'
-    }
-});
-
-export interface FileTreeItemProps {
-    item: TreeItem<FileTreeData>;
-    onMoreClick: (event: React.MouseEvent<any>, item: TreeItem<FileTreeData>) => void;
-}
-export const FileTreeItem = withStyles(fileTreeItemStyle)(
-    class extends React.Component<FileTreeItemProps & WithStyles<CssRules>> {
-        render() {
-            const { classes, item } = this.props;
-            return <>
-                <div className={classes.root}>
-                    <ListItemTextIcon
-                        icon={getIcon(item.data.type)}
-                        name={item.data.name} />
-                    <div className={classes.spacer} />
-                    <Typography
-                        className={classes.sizeInfo}
-                        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 >
-            </>;
-        }
-
-        handleClick = (event: React.MouseEvent<any>) => {
-            this.props.onMoreClick(event, this.props.item);
-        }
-    });
+import { DirectoryIcon, DefaultIcon, FileIcon } from "../icon/icon";
 
 export const getIcon = (type: string) => {
     switch (type) {