<commit_before>import React, { Component, PropTypes } from 'react';
import { DownloadLink } from '@jenkins-cd/design-language';

import { Icon } from 'react-material-icons-blue';

const { string } = PropTypes;


// FIXME: add fetchRunLog in actions for getting data
export default class LogToolbar extends Component {
    render() {
        const { fileName, data, url } = this.props;
        // early out
        if (!url) {
            return null;
        }
        const style = { fill: '#4a4a4a' };
        return (<div className="log-header">
            <div className="log-header__section">
                Build log – Build > Build source
            </div>
            <div className="log-header__section download-log-button">
              { data && <DownloadLink {...{ style, fileData: {
                  filename: fileName,
                  contents: data,
                  mime: 'text/plain',
              } }}
              />}

                <a {...{
                    title: 'Display the log in new window',
                    target: '_blank',
                    href: url,
                }}
                >
                    <Icon {...{ style, icon: 'launch' }} />
                </a>
            </div>
        </div>);
    }
}

LogToolbar.propTypes = {
    data: string,
    fileName: string,
    url: string.isRequired,
};
<commit_msg>[JENKINS-35912] fix lint<commit_after>import React, { Component, PropTypes } from 'react';
import { DownloadLink } from '@jenkins-cd/design-language';

import { Icon } from 'react-material-icons-blue';

const { string } = PropTypes;


// FIXME: add fetchRunLog in actions for getting data
export default class LogToolbar extends Component {
    render() {
        const { fileName, data, url } = this.props;
        // early out
        if (!url) {
            return null;
        }
        const style = { fill: '#4a4a4a' };
        return (<div className="log-header">
            <div className="log-header__section">
                Build log – Build > Build source
            </div>
            <div className="log-header__section download-log-button">
              { data && <DownloadLink {...{ style, fileData: {
                  filename: fileName,
                  contents: data,
                  mime: 'text/plain',
              } }}
              />}

                <a { ...{
                    title: 'Display the log in new window',
                    target: '_blank',
                    href: url } }
                >
                    <Icon {...{ style, icon: 'launch' }} />
                </a>
            </div>
        </div>);
    }
}

LogToolbar.propTypes = {
    data: string,
    fileName: string,
    url: string.isRequired,
};

{'fraction_non_alphanumeric': 0.1261852662290299, 'fraction_numerical': 0.0040116703136396795, 'mean_word_length': 1.427433628318584, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6644221', 'n_tokens_mistral': 746, 'n_tokens_neox': 724, 'n_words': 198}