import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import classnames from 'classnames'; import Result from '../presentational/Result'; const Results = (({ results, isExactMatch, selectedResult }) => (
0, })} > {!isExactMatch && results.map(userId => ( ))}
)); Results.propTypes = { results: PropTypes.arrayOf(PropTypes.string).isRequired, isExactMatch: PropTypes.bool.isRequired, selectedResult: PropTypes.string, }; Results.defaultProps = { selectedResult: null, }; const mapStateToProps = state => ({ results: state.search.results, isExactMatch: state.search.isExactMatch, selectedResult: state.search.selectedResult, }); export default connect(mapStateToProps)(Results);