<commit_before>import * as React from 'react';
import { classes, style } from 'typestyle';
import {
  toolbarItemClass,
  toolbarButtonClass,
  toolbarButtonIconClass,
} from '../style/toolbar';

import { Props } from './panel';

export interface State {
  label: string;
  style: ReturnType<typeof style>;
  options?: any;
}

// TO DO (ashleyswang): Change to non-inheritance implementation of React Component

export abstract class ToolbarButton extends React.Component<Props, State> {
  constructor(
    props: Props,
    init_label: string,
    init_style: ReturnType<typeof style>,
    init_options?: any,
  ) {
    super(props);
    this.state = {
      label: init_label,
      style: init_style,
      options: init_options ? init_options : undefined,
    };
  }

  render(): React.ReactElement {
    return (
      <div
        className={classes(
          'jp-ToolbarButton',
          'jp-Toolbar-item',
          toolbarItemClass
        )}
      >
        <button
          className={classes(
            'bp3-button',
            'bp3-minimal',
            'jp-ToolbarButtonComponent',
            'minimal',
            'jp-Button',
            toolbarButtonClass
          )}
          title={this.state.label}
          onClick={this._onClick}
        >
          <span className={classes('bp3-button-text')}>
            <span
              className={classes(
                'jp-ToolbarButtonComponent-icon',
                toolbarButtonIconClass,
                this.state.style
              )}
            >
            </span>
          </span>
        </button>
      </div>
    );
  }

  protected _onClick = (): void => {
    // TO DO (ashleyswang): pass in _onClick function as props
    return;
  };
}<commit_msg>add note for options state attribute for buttons<commit_after>import * as React from 'react';
import { classes, style } from 'typestyle';
import {
  toolbarItemClass,
  toolbarButtonClass,
  toolbarButtonIconClass,
} from '../style/toolbar';

import { Props } from './panel';

/* Note for "options" attribute in state:

 * This attribute is used for subclasses of the ToolbarButton
 * that may need other state attributes (such as running). Since
 * different children may need different additional attributes,
 * we can pass in an 'options' parameter that can be used to 
 * include additional parameters. 

 * This will be changed once the class is refactored to be 
 * implemented without inheritance.
 */

export interface State {
  label: string;
  style: ReturnType<typeof style>;
  options?: any;
}

// TO DO (ashleyswang): Change to non-inheritance implementation of React Component

export abstract class ToolbarButton extends React.Component<Props, State> {
  constructor(
    props: Props,
    init_label: string,
    init_style: ReturnType<typeof style>,
    init_options?: any,
  ) {
    super(props);
    this.state = {
      label: init_label,
      style: init_style,
      options: init_options ? init_options : undefined,
    };
  }

  render(): React.ReactElement {
    return (
      <div
        className={classes(
          'jp-ToolbarButton',
          'jp-Toolbar-item',
          toolbarItemClass
        )}
      >
        <button
          className={classes(
            'bp3-button',
            'bp3-minimal',
            'jp-ToolbarButtonComponent',
            'minimal',
            'jp-Button',
            toolbarButtonClass
          )}
          title={this.state.label}
          onClick={this._onClick}
        >
          <span className={classes('bp3-button-text')}>
            <span
              className={classes(
                'jp-ToolbarButtonComponent-icon',
                toolbarButtonIconClass,
                this.state.style
              )}
            >
            </span>
          </span>
        </button>
      </div>
    );
  }

  protected _onClick = (): void => {
    // TO DO (ashleyswang): pass in _onClick function as props
    return;
  };
}
{'fraction_non_alphanumeric': 0.10606060606060606, 'fraction_numerical': 0.0015151515151515152, 'mean_word_length': 2.035249042145594, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 27, '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': '3137046', 'n_tokens_mistral': 1117, 'n_tokens_neox': 1075, 'n_words': 286}