<commit_before>import React from 'react';
import Button from 'components/button';
import Icon from 'components/icon';
import cx from 'classnames';

import iconInfo from 'assets/icons/info.svg';
import iconDownload from 'assets/icons/download.svg';
import iconAddToUser from 'assets/icons/add-to-user.svg';
import PropTypes from 'prop-types';
import ShareMenu from 'components/share-menu';

import styles from './button-group-styles.scss';

const ButtonGroup = ({ className, buttonsConfig, disabled }) => (
  <div
    className={cx(
      styles.buttonGroup,
      disabled ? styles.disabled : '',
      className
    )}
  >
    {buttonsConfig.map(buttonConfig => {
      let button = null;
      switch (buttonConfig.type) {
        case 'info':
          button = (
            <Button
              key={buttonConfig.type}
              className={cx(styles.button, styles.first)}
              onClick={buttonConfig.onInfoClick}
              disabled={!buttonConfig.onInfoClick}
            >
              <Icon icon={iconInfo} />
            </Button>
          );
          break;
        case 'share':
          button = (
            <ShareMenu
              key={buttonConfig.type}
              className={cx(styles.button, styles.share)}
              path={buttonConfig.shareUrl}
              inButtonGroup
              analyticsGraphName={buttonConfig.analyticsGraphName}
              reverse={buttonConfig.reverseDropdown}
            />
          );
          break;
        case 'download':
          button = (
            <Button
              key={buttonConfig.type}
              className={styles.button}
              onClick={buttonConfig.onDownloadClick}
              disabled={!buttonConfig.onDownloadClick}
            >
              <Icon icon={iconDownload} />
            </Button>
          );
          break;
        case 'add-to-user':
          button = (
            <Button
              key={buttonConfig.type}
              className={cx(styles.button, styles.last)}
              onClick={buttonConfig.onAddToUserClick}
              disabled={!buttonConfig.onAddToUserClick}
            >
              <Icon icon={iconAddToUser} />
            </Button>
          );
          break;
        default:
          break;
      }
      return button;
    })}
  </div>
);

ButtonGroup.propTypes = {
  className: PropTypes.string,<commit_msg>adding 2 more buttons to the button group<commit_after>import React from 'react';
import Button from 'components/button';
import Icon from 'components/icon';
import cx from 'classnames';

import iconInfo from 'assets/icons/info.svg';
import iconDownload from 'assets/icons/download.svg';
import iconAddToUser from 'assets/icons/add-to-user.svg';
import iconEdit from 'assets/icons/edit.svg';
import iconDelete from 'assets/icons/delete.svg';
import PropTypes from 'prop-types';
import ShareMenu from 'components/share-menu';

import styles from './button-group-styles.scss';

const ButtonGroup = ({ className, buttonsConfig, disabled }) => (
  <div
    className={cx(
      styles.buttonGroup,
      disabled ? styles.disabled : '',
      className
    )}
  >
    {buttonsConfig.map(buttonConfig => {
      let button = null;
      switch (buttonConfig.type) {
        case 'info':
          button = (
            <Button
              key={buttonConfig.type}
              className={cx(styles.button, styles.first)}
              onClick={buttonConfig.onInfoClick}
              disabled={!buttonConfig.onInfoClick}
            >
              <Icon icon={iconInfo} />
            </Button>
          );
          break;
        case 'share':
          button = (
            <ShareMenu
              key={buttonConfig.type}
              className={cx(styles.button, styles.share)}
              path={buttonConfig.shareUrl}
              inButtonGroup
              analyticsGraphName={buttonConfig.analyticsGraphName}
              reverse={buttonConfig.reverseDropdown}
            />
          );
          break;
        case 'download':
          button = (
            <Button
              key={buttonConfig.type}
              className={styles.button}
              onClick={buttonConfig.onDownloadClick}
              disabled={!buttonConfig.onDownloadClick}
            >
              <Icon icon={iconDownload} />
            </Button>
          );
          break;
        case 'add-to-user':
          button = (
            <Button
              key={buttonConfig.type}
              className={cx(styles.button, styles.last)}
              onClick={buttonConfig.onAddToUserClick}
              disabled={!buttonConfig.onAddToUserClick}
            >
              <Icon icon={iconAddToUser} />
            </Button>
          );
          break;
        case 'edit':
          button = (
            <Button
              key={buttonConfig.type}
              className={cx(styles.button, styles.last)}
              onClick={buttonConfig.onEditClick}
              disabled={!buttonConfig.onEditClick}
            >
              <Icon icon={iconEdit} />
            </Button>
          );
          break;
        case 'delete':
          button = (
            <Button
              key={buttonConfig.type}
              className={cx(styles.button, styles.last)}
              onClick={buttonConfig.onDeleteClick}
              disabled={!buttonConfig.onDeleteClick}
            >
              <Icon icon={iconDelete} />
            </Button>
          );
          break;
        default:
          break;
      }
      return button;
    })}
  </div>
);

ButtonGroup.propTypes = {
  className: PropTypes.string,
{'fraction_non_alphanumeric': 0.1095695482034863, 'fraction_numerical': 0.00017787264318747776, 'mean_word_length': 1.6649289099526066, 'pattern_counts': {'":': 0, '<': 33, '<?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': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1089418', 'n_tokens_mistral': 1411, 'n_tokens_neox': 1419, 'n_words': 270}