<commit_before>import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import RaisedButton from 'material-ui/RaisedButton';
import LinearProgress from 'material-ui/LinearProgress';
import SongList from '@/components/SongList';
import Search from '@/components/Search';
import { fetchSongs } from '@/modules/search/actions';

const SearchContainer = ({ onSearchChange, addMoreSongs, songs, searchInput, loading }) => (
  <div className="search-wrapper">
    <Search onChange={onSearchChange} />
    <SongList songs={songs} />
    <div>
      {(songs.length > 0) && (
        <RaisedButton
          label="More"
          onClick={addMoreSongs(searchInput)}
        />
      )}
      {(loading) && (
        <LinearProgress />
      )}
    </div>
  </div>
);

SearchContainer.propTypes = {
  loading: PropTypes.bool.isRequired,
  searchInput: PropTypes.string.isRequired,
  songs: PropTypes.arrayOf(PropTypes.object).isRequired,
  onSearchChange: PropTypes.func.isRequired,
  addMoreSongs: PropTypes.func.isRequired,
};

function mapStateToProps(state) {
  const { search: { searchInput, songs, loading } } = state;

  return {
    searchInput,
    songs,
    loading,
  };
}

function mapDispatchToProps(dispatch) {
  return {
    onSearchChange: (event, searchInput) => {
      dispatch(fetchSongs(searchInput));
    },
    addMoreSongs: searchInput => () => {
      dispatch(fetchSongs(searchInput));
    },
  };
}

export default connect(mapStateToProps, mapDispatchToProps)(SearchContainer);<commit_msg>#3 refactor(search): Use mapDispatchToProps shorthand notation<commit_after>import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import RaisedButton from 'material-ui/RaisedButton';
import LinearProgress from 'material-ui/LinearProgress';
import SongList from '@/components/SongList';
import Search from '@/components/Search';
import { fetchSongs, fetchMoreSongs } from '@/modules/search/actions';

const SearchContainer = ({ onSearchChange, addMoreSongs, songs, searchInput, loading }) => (
  <div className="search-wrapper">
    <Search onChange={(event, searchInputNow) => onSearchChange(searchInputNow)} />
    <SongList songs={songs} />
    <div>
      {(songs.length > 0) && (
        <RaisedButton
          label="More"
          onClick={() => addMoreSongs(searchInput)}
        />
      )}
      {(loading) && (
        <LinearProgress />
      )}
    </div>
  </div>
);

SearchContainer.propTypes = {
  loading: PropTypes.bool.isRequired,
  searchInput: PropTypes.string.isRequired,
  songs: PropTypes.arrayOf(PropTypes.object).isRequired,
  onSearchChange: PropTypes.func.isRequired,
  addMoreSongs: PropTypes.func.isRequired,
};

function mapStateToProps(state) {
  const { search: { searchInput, songs, loading } } = state;

  return {
    searchInput,
    songs,
    loading,
  };
}

const mapDispatchToProps = {
  onSearchChange: fetchSongs,
  addMoreSongs: fetchMoreSongs,
};

export default connect(mapStateToProps, mapDispatchToProps)(SearchContainer);
{'fraction_non_alphanumeric': 0.13146762121705174, 'fraction_numerical': 0.0009762447120078099, 'mean_word_length': 3.9821717990275527, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 28, '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': '5982449', 'n_tokens_mistral': 928, 'n_tokens_neox': 908, 'n_words': 188}