{"size": 1159, "ext": "js", "max_stars_repo_path": "client/components/ProfilePage/UsersList.js", "max_stars_repo_name": "Pumpkin-Cap/Pumpkin-Cap-Repo", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "client/components/ProfilePage/UsersList.js", "max_issues_repo_name": "Pumpkin-Cap/Pumpkin-Cap-Repo", "max_issues_repo_issues_event_min_datetime": "2021-08-19T01:11:39.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-28T20:15:12.000Z", "max_forks_repo_path": "client/components/ProfilePage/UsersList.js", "max_forks_repo_name": "Pumpkin-Cap/Pumpkin-Cap-Repo", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 13, "max_forks_count": null, "avg_line_length": 26.3409090909, "max_line_length": 104, "alphanum_fraction": 0.5573770492}
import React from 'react';
import  { connect } from 'react-redux';
import { Link } from 'react-router-dom'


class UsersList extends React.Component{

  constructor(props) {
      super(props)
  }

  render() {
    const { allUsers, search } = this.props;
    return (
      <div id="profile-all-users-list-container">

        {(Array.isArray(allUsers) && search(allUsers).length > 0)  ? ((
        <div>
          <div style={{display:"flex", justifyContent:"center"}} id="all-users-list-title">Users</div>
          <div id="all-users-list">{search(allUsers).map((element) => (
            <div key={element.id}>
              <Link to={`/user/${element.id}` }>{element.username}</Link>
              </div>))}
            </div>
          </div>)
          ) : (
          <div>
            <div style={{display:"flex", justifyContent:"center"}} id="all-users-list-title">Users</div>
            <div id="all-users-list" style={{fontSize:"small"}}>No users match your search</div>
          </div>)}
      </div>
    )
  }
}


const mapState = (state) => ({
  auth: state.auth,
  allUsers: state.allUsers
});


export default connect(mapState)(UsersList)
