import { LoadingSpinner } from '@sourcegraph/react-loading-spinner';
import { ChevronDownIcon } from 'mdi-react';
import ChevronRightIcon from 'mdi-react/ChevronRightIcon';
import * as React from 'react';
import { Link } from 'react-router-dom';
import { treePadding } from './util';
/**
 * JSX to render a tree directory
 * @param props
 */
export const Directory = (props) => (React.createElement("tr", { key: props.entryInfo.path, className: props.className, onClick: props.handleTreeClick },
    React.createElement("td", { className: "tree__cell" },
        React.createElement("div", { className: "tree__row-contents tree__row-contents-new", "data-tree-is-directory": "true", "data-tree-path": props.entryInfo.path },
            React.createElement("div", { className: "tree__row-contents-text" },
                React.createElement("a", { className: "tree__row-icon", href: props.entryInfo.url, onClick: props.noopRowClick, 
                    // tslint:disable-next-line:jsx-ban-props (needed because of dynamic styling)
                    style: treePadding(props.depth, true), tabIndex: -1 }, props.isExpanded ? (React.createElement(ChevronDownIcon, { className: "icon-inline" })) : (React.createElement(ChevronRightIcon, { className: "icon-inline" }))),
                React.createElement(Link, { to: props.entryInfo.url, onClick: props.linkRowClick, className: "tree__row-label", draggable: false, title: props.entryInfo.path, tabIndex: -1 }, props.entryInfo.name)),
            props.loading && (React.createElement("div", { className: "tree__row-loader" },
                React.createElement(LoadingSpinner, { className: "icon-inline tree-page__entries-loader" })))),
        props.index === props.maxEntries - 1 && (React.createElement("div", { className: "tree__row-alert alert alert-warning", 
            // tslint:disable-next-line:jsx-ban-props (needed because of dynamic styling)
            style: treePadding(props.depth, true) }, "Too many entries. Use search to find a specific file.")))));
//# sourceMappingURL=Directory.js.map