<commit_before>// @flow
import React, { Component } from 'react';
import { observer } from 'mobx-react';
import classnames from 'classnames';
import { Button } from 'react-polymorph/lib/components';
import { ButtonSkin } from 'react-polymorph/lib/skins/simple';
import styles from './MnemonicWord.scss';

type Props = {
  word: string,
  index: number,
  isActive: boolean,
  onClick: Function,
};

@observer
export default class MnemonicWord extends Component<Props> {

  render() {
    const { word, index, isActive, onClick } = this.props;
    const componentClassNames = classnames([
      'flat',
      styles.component,
      isActive ? styles.active : styles.inactive
    ]);
    return (
      <Button
        className={componentClassNames}
        label={word}
        onClick={() => onClick({ word, index })}
        skin={ButtonSkin}
      />
    );
  }

}<commit_msg>[DDW-245] Passes Button component MnemonicWord.scss's custom styles as themeOverrides. Defines onClick handler as const.<commit_after>// @flow
import React, { Component } from 'react';
import { observer } from 'mobx-react';
import { Button } from 'react-polymorph/lib/components';
import { ButtonSkin } from 'react-polymorph/lib/skins/simple';
import styles from './MnemonicWord.scss';

type Props = {
  word: string,
  index: number,
  isActive: boolean,
  onClick: Function,
};

@observer
export default class MnemonicWord extends Component<Props> {

  render() {
    const { word, index, isActive, onClick } = this.props;
    const handleClick = onClick.bind(null, { word, index });

    return (
      <Button
        className="flat"
        themeOverrides={styles}
        disabled={!isActive}
        label={word}
        onClick={handleClick}
        skin={ButtonSkin}
      />
    );
  }

}
{'fraction_non_alphanumeric': 0.12703766160764474, 'fraction_numerical': 0.0016863406408094434, 'mean_word_length': 3.238095238095238, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, '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': '7661193', 'n_tokens_mistral': 546, 'n_tokens_neox': 535, 'n_words': 141}