<commit_before>import classNames from 'classnames/dedupe';
import React from 'react';

class FullScreenModalHeaderActions extends React.Component {
  getActions() {
    let {actions} = this.props;

    if (!actions || actions.length === 0) {
      return null;
    }

    return actions.map(({className, clickHandler, label, node}, index) => {
      if (node) {
        return node;
      }

      let classes = classNames('button', className);

      return (
        <button className={classes} key={index} onClick={clickHandler}>
          {label}
        </button>
      );
    });
  }

  render() {
    let {className, type} = this.props;

    let classes = classNames(
      `modal-full-screen-actions modal-full-screen-actions-${type} button-collection flush-vertical`,
      className
    );

    return (
      <div className={classes}>
        {this.getActions()}
      </div>
    );
  }
}

const classProps = React.PropTypes.oneOfType([
  React.PropTypes.array,
  React.PropTypes.object,
  React.PropTypes.string
]);

FullScreenModalHeaderActions.propTypes = {
  actions: React.PropTypes.arrayOf(
    React.PropTypes.shape({
      className: classProps,
      clickHandler: React.PropTypes.func,
      label: React.PropTypes.node<commit_msg>FullScreenModalHeaderActions: Adding `disabled` prop<commit_after>import classNames from 'classnames/dedupe';
import React from 'react';

class FullScreenModalHeaderActions extends React.Component {
  getActions() {
    let {actions} = this.props;

    if (!actions || actions.length === 0) {
      return null;
    }

    return actions.map(
      ({className, clickHandler, label, node, disabled}, index) => {
        if (node) {
          return node;
        }

        let classes = classNames('button', className);

        return (
          <button className={classes}
            disabled={disabled}
            key={index}
            onClick={clickHandler}>
            {label}
          </button>
        );
      }
    );
  }

  render() {
    let {className, type} = this.props;

    let classes = classNames(
      `modal-full-screen-actions modal-full-screen-actions-${type} button-collection flush-vertical`,
      className
    );

    return (
      <div className={classes}>
        {this.getActions()}
      </div>
    );
  }
}

const classProps = React.PropTypes.oneOfType([
  React.PropTypes.array,
  React.PropTypes.object,
  React.PropTypes.string
]);

FullScreenModalHeaderActions.propTypes = {
  actions: React.PropTypes.arrayOf(
    React.PropTypes.shape({
      className: classProps,
      clickHandler: React.PropTypes.func,
      label: React.PropTypes.node
{'fraction_non_alphanumeric': 0.1253313138962514, 'fraction_numerical': 0.0007572889057175312, 'mean_word_length': 2.609289617486339, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '1788327', 'n_tokens_mistral': 773, 'n_tokens_neox': 764, 'n_words': 159}