<commit_before>
import React, {PropTypes, Component} from 'react'
import {connect} from './connect'

import * as actions from '../actions'

import Icon from './icon'

/**
 * Unapologetically and heavily inspired from Google Chrome's "shit went wrong" tab
 */
export class Toast extends Component {
  constructor () {
    super()
    this.state = {
      expanded: false
    }

    this.toggleExpand = ::this.toggleExpand
    this.sendFeedback = ::this.sendFeedback
    this.reload = ::this.reload
  }

  toggleExpand () {
    this.setState({
      expanded: !this.state.expanded
    })
  }

  sendFeedback () {
    const {reportIssue, data} = this.props
    const {error, stack} = data

    reportIssue({log: error + '\n\nstack:\n' + stack})
  }

  reload (e) {
    const {evolveTab, data, tabId} = this.props
    const {path} = data
    const untoastedPath = path.replace(/^toast\//, '')

    evolveTab({id: tabId, path: untoastedPath, quick: true})
  }

  render () {
    const {t, data = {}} = this.props

    return <div className='toast-meat'>
      <Icon icon='heart-broken' classes='leader'/>
      <h2>{t('toast.title')}</h2>

      <p>{t('toast.message')} {t('toast.call_to_action')}</p>

      <div className='button' onClick={this.reload}>
	<Icon icon='repeat'/> {t('toast.actions.reload')}
      </div>

      <span className='link' onClick={this.toggleExpand}>{t('toast.actions.learn_more')}</span>

      {this.state.expanded
      ? <p className='error'>{data.error}</p>
      : ''}

      <span className='link' onClick={this.sendFeedback}>{t('toast.actions.report')}</span>
    </div>
  }
}

Toast.propTypes = {
  t: PropTypes.func.isRequired,
  data: PropTypes.string.isRequired,
  tabId: PropTypes.string.isRequired,

  evolveTab: PropTypes.func.isRequired,
  reportIssue: PropTypes.func.isRequired
}

const mapStateToProps = (state) => ({})
<commit_msg>:shirt: more lint<commit_after>
import React, {PropTypes, Component} from 'react'
import {connect} from './connect'

import * as actions from '../actions'

import Icon from './icon'

/**
 * Unapologetically and heavily inspired from Google Chrome's "shit went wrong" tab
 */
export class Toast extends Component {
  constructor () {
    super()
    this.state = {
      expanded: false
    }

    this.toggleExpand = ::this.toggleExpand
    this.sendFeedback = ::this.sendFeedback
    this.reload = ::this.reload
  }

  toggleExpand () {
    this.setState({
      expanded: !this.state.expanded
    })
  }

  sendFeedback () {
    const {reportIssue, data} = this.props
    const {error, stack} = data

    reportIssue({log: error + '\n\nstack:\n' + stack})
  }

  reload (e) {
    const {evolveTab, data, tabId} = this.props
    const {path} = data
    const untoastedPath = path.replace(/^toast\//, '')

    evolveTab({id: tabId, path: untoastedPath, quick: true})
  }

  render () {
    const {t, data = {}} = this.props

    return <div className='toast-meat'>
      <Icon icon='heart-broken' classes='leader'/>
      <h2>{t('toast.title')}</h2>

      <p>{t('toast.message')} {t('toast.call_to_action')}</p>

      <div className='button' onClick={this.reload}>
        <Icon icon='repeat'/> {t('toast.actions.reload')}
      </div>

      <span className='link' onClick={this.toggleExpand}>{t('toast.actions.learn_more')}</span>

      {this.state.expanded
      ? <p className='error'>{data.error}</p>
      : ''}

      <span className='link' onClick={this.sendFeedback}>{t('toast.actions.report')}</span>
    </div>
  }
}

Toast.propTypes = {
  t: PropTypes.func.isRequired,
  data: PropTypes.string.isRequired,
  tabId: PropTypes.string.isRequired,

  evolveTab: PropTypes.func.isRequired,
  reportIssue: PropTypes.func.isRequired
}

const mapStateToProps = (state) => ({})

{'fraction_non_alphanumeric': 0.16768698429598083, 'fraction_numerical': 0.001064679265371307, 'mean_word_length': 3.2415349887133185, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 37, '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': '89378', 'n_tokens_mistral': 1289, 'n_tokens_neox': 1254, 'n_words': 258}