import * as React from 'react';
import { Link } from 'react-router-dom';
import { RepositoryIcon } from '../util/icons';
import { maxEntries, treePadding } from './util';
export const File = (props) => (React.createElement("tr", { key: props.entryInfo.path, className: props.className },
    React.createElement("td", { className: "tree__cell" },
        props.entryInfo.submodule ? (props.entryInfo.url ? (React.createElement(Link, { to: props.entryInfo.url, onClick: props.linkRowClick, draggable: false, title: 'Submodule: ' + props.entryInfo.submodule.url, className: "tree__row-contents", "data-tree-path": props.entryInfo.path },
            React.createElement("div", { className: "tree__row-contents-text" },
                React.createElement("span", { className: "tree__row-icon", onClick: props.noopRowClick, 
                    // tslint:disable-next-line:jsx-ban-props (needed because of dynamic styling)
                    style: treePadding(props.depth, true), tabIndex: -1 },
                    React.createElement(RepositoryIcon, { className: "icon-inline" })),
                React.createElement("span", { className: "tree__row-label" },
                    props.entryInfo.name,
                    " @ ",
                    props.entryInfo.submodule.commit.substr(0, 7))))) : (React.createElement("div", { className: "tree__row-contents", title: 'Submodule: ' + props.entryInfo.submodule.url },
            React.createElement("div", { className: "tree__row-contents-text" },
                React.createElement("span", { className: "tree__row-icon", 
                    // tslint:disable-next-line:jsx-ban-props (needed because of dynamic styling)
                    style: treePadding(props.depth, true) },
                    React.createElement(RepositoryIcon, { className: "icon-inline" })),
                React.createElement("span", { className: "tree__row-label" },
                    props.entryInfo.name,
                    " @ ",
                    props.entryInfo.submodule.commit.substr(0, 7)))))) : (React.createElement(Link, { className: "tree__row-contents", to: props.entryInfo.url, onClick: props.linkRowClick, "data-tree-path": props.entryInfo.path, draggable: false, title: props.entryInfo.path, 
            // tslint:disable-next-line:jsx-ban-props (needed because of dynamic styling)
            style: treePadding(props.depth, false), tabIndex: -1 }, props.entryInfo.name)),
        props.index === 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=File.js.map