<commit_before>import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';

import SpaceItem from '@ciscospark/react-component-space-item';

const propTypes = {
  activeSpaceId: PropTypes.string,
  currentUser: PropTypes.shape({
    id: PropTypes.string.isRequired
  }).isRequired,
  hasCalling: PropTypes.bool,
  onCallClick: PropTypes.func,
  onClick: PropTypes.func,
  spaces: PropTypes.oneOfType([
    PropTypes.arrayOf(
      PropTypes.shape({
        avatarUrl: PropTypes.string,
        activityText: PropTypes.oneOfType([
          PropTypes.string,
          PropTypes.element
        ]),
        callStartTime: PropTypes.number,
        id: PropTypes.string,
        isDecrypting: PropTypes.bool,
        isUnread: PropTypes.bool,
        lastActivityTime: PropTypes.string,
        name: PropTypes.string,
        teamColor: PropTypes.string,
        teamName: PropTypes.string,
        type: PropTypes.string
      })
    ),
    // Can accept an object that can iterated with `forEach`
    PropTypes.object
  ])
};

const defaultProps = {
  activeSpaceId: '',
  hasCalling: false,
  onCallClick: () => {},
  onClick: () => {},
  spaces: []
};

export default function SpacesList({
  activeSpaceId,
  currentUser,
  hasCalling,
  onCallClick,
  onClick,
  spaces
}) {
  const recents = [];
  spaces.forEach((space) => recents.push(<SpaceItem
    active={space.id === activeSpaceId}
    currentUser={currentUser}
    hasCalling={hasCalling}
    key={space.id}
    onCallClick={onCallClick}
    onClick={onClick}
    {...space}
  />));

  return (
    <div className={classNames('ciscospark-spaces-list')}>
      {recents}
    </div>
  );
}

SpacesList.propTypes = propTypes;
SpacesList.defaultProps = defaultProps;
<commit_msg>feat(spaces-list): remove unused currentUser prop<commit_after>import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';

import SpaceItem from '@ciscospark/react-component-space-item';

const propTypes = {
  activeSpaceId: PropTypes.string,
  hasCalling: PropTypes.bool,
  onCallClick: PropTypes.func,
  onClick: PropTypes.func,
  spaces: PropTypes.oneOfType([
    PropTypes.arrayOf(
      PropTypes.shape({
        avatarUrl: PropTypes.string,
        activityText: PropTypes.oneOfType([
          PropTypes.string,
          PropTypes.element
        ]),
        callStartTime: PropTypes.number,
        id: PropTypes.string,
        isDecrypting: PropTypes.bool,
        isUnread: PropTypes.bool,
        lastActivityTime: PropTypes.string,
        name: PropTypes.string,
        teamColor: PropTypes.string,
        teamName: PropTypes.string,
        type: PropTypes.string
      })
    ),
    // Can accept an object that can iterated with `forEach`
    PropTypes.object
  ])
};

const defaultProps = {
  activeSpaceId: '',
  hasCalling: false,
  onCallClick: () => {},
  onClick: () => {},
  spaces: []
};

export default function SpacesList({
  activeSpaceId,
  hasCalling,
  onCallClick,
  onClick,
  spaces
}) {
  const recents = [];
  spaces.forEach((space) => recents.push(<SpaceItem
    active={space.id === activeSpaceId}
    hasCalling={hasCalling}
    key={space.id}
    onCallClick={onCallClick}
    onClick={onClick}
    {...space}
  />));

  return (
    <div className={classNames('ciscospark-spaces-list')}>
      {recents}
    </div>
  );
}

SpacesList.propTypes = propTypes;
SpacesList.defaultProps = defaultProps;

{'fraction_non_alphanumeric': 0.12286788089043076, 'fraction_numerical': 0.0, 'mean_word_length': 3.133811230585424, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, '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': '6818428', 'n_tokens_mistral': 1044, 'n_tokens_neox': 1090, 'n_words': 213}