import * as React from 'react';
import { Link } from 'react-router-dom';
import { displayRepoPath, splitPath } from '../components/RepoFileLink';
export const RepoLink = ({ repoPath, to, className, onClick }) => {
    const [repoBase, repoName] = splitPath(displayRepoPath(repoPath));
    const children = (React.createElement(React.Fragment, null,
        ' ',
        repoBase ? `${repoBase}/` : null,
        React.createElement("strong", null, repoName)));
    if (to === null) {
        return children;
    }
    return (React.createElement(Link, { className: className || '', to: to, onClick: onClick }, children));
};
//# sourceMappingURL=RepoLink.js.map