<commit_before>import React from "react"; // eslint-disable-line no-unused-vars

class CountryMap extends React.Component {
  constructor(props) {
    super(props);
    this.state = { SVG: "" };
  }
  componentWillMount() {
    let component = this;
    // TODO move to country-specific bucket or at least folder
    if (this.props.countrycode && this.props.countrycode !== null) {
      fetch(process.env.REACT_APP_ASSETS_URL + this.props.countrycode + ".svg")
        .then(function(response) {
          return response.text();
        })
        .then(function(SVGtext) {
          let svg = '<svg class="country-map" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" version="1.1"><defs><style type="text/css"><![CDATA[.country-map path {stroke: none;fill: #d8382c;}]]></style></defs>' +
            SVGtext +
            "</svg>";
          component.setState({ SVG: svg });
        });
    }
  }

  render() {
    return this.props.countrycode
      ? <div>
          <div dangerouslySetInnerHTML={{ __html: this.state.SVG }} />
          {this.props.city
            ? <p className="case-location">
                {this.props.city}, {this.props.countrycode}
              </p>
            : <p className="case-location">{this.props.countrycode}</p>}
        </div>
      : <div />;
  }
}

export default CountryMap;<commit_msg>Use new bucket that has properly sized SVG assets<commit_after>import React from "react"; // eslint-disable-line no-unused-vars

class CountryMap extends React.Component {
  constructor(props) {
    super(props);
    this.state = { SVG: "" };
  }
  componentWillMount() {
    let component = this;
    // TODO move to country-specific bucket or at least folder
    if (this.props.countrycode && this.props.countrycode !== null) {
      fetch(
        process.env.REACT_APP_ASSETS_URL +
          "countries/fullname/" +
          this.props.countrycode +
          ".svg?"
      )
        .then(function(response) {
          return response.text();
        })
        .then(function(SVGtext) {
          component.setState({ SVG: SVGtext });
        });
    }
  }

  render() {
    return this.props.countrycode
      ? <div className="case-map">
          <div dangerouslySetInnerHTML={{ __html: this.state.SVG }} />
          {this.props.city
            ? <p className="case-location">
                {this.props.city}, {this.props.countrycode}
              </p>
            : <p className="case-location">{this.props.countrycode}</p>}
        </div>
      : <div />;
  }
}

export default CountryMap;
{'fraction_non_alphanumeric': 0.1522504892367906, 'fraction_numerical': 0.006653620352250489, 'mean_word_length': 2.231352718078382, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1527213', 'n_tokens_mistral': 792, 'n_tokens_neox': 776, 'n_words': 149}