<commit_before>import React from 'react';
import PropTypes from 'prop-types';

export default class Permalink extends React.PureComponent {

  static contextTypes = {
    router: PropTypes.object,
  };

  static propTypes = {
    className: PropTypes.string,
    href: PropTypes.string.isRequired,
    to: PropTypes.string.isRequired,
    children: PropTypes.node,
  };

  handleClick = (e) => {
    if (e.button === 0 && !(e.ctrlKey || e.metaKey)) {
      e.preventDefault();
      this.context.router.history.push(this.props.to);
    }
  }

  render () {
    const { href, children, className, ...other } = this.props;

    return (
      <a href={href} onClick={this.handleClick} {...other} className={'permalink ' + className}>
        {children}
      </a>
    );
  }

}<commit_msg>Fix "undefined" in className (#3939)<commit_after>import React from 'react';
import PropTypes from 'prop-types';

export default class Permalink extends React.PureComponent {

  static contextTypes = {
    router: PropTypes.object,
  };

  static propTypes = {
    className: PropTypes.string,
    href: PropTypes.string.isRequired,
    to: PropTypes.string.isRequired,
    children: PropTypes.node,
  };

  handleClick = (e) => {
    if (e.button === 0 && !(e.ctrlKey || e.metaKey)) {
      e.preventDefault();
      this.context.router.history.push(this.props.to);
    }
  }

  render () {
    const { href, children, className, ...other } = this.props;

    return (
      <a href={href} onClick={this.handleClick} {...other} className={`permalink${className ? ' ' + className : ''}`}>
        {children}
      </a>
    );
  }

}
{'fraction_non_alphanumeric': 0.15441630636195183, 'fraction_numerical': 0.0037059913526868438, 'mean_word_length': 2.9225181598062955, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '2486593', 'n_tokens_mistral': 513, 'n_tokens_neox': 513, 'n_words': 110}