import React from "react"; const PropTypes = React.PropTypes; const UserDetails = (user) => { return (
{user.score &&
  • Score: {user.score}

  • }
  • {user.info.name &&
  • Name: {user.info.name}
  • }
  • Username: {user.info.login}
  • {user.info.location &&
  • Location: {user.info.location}
  • } {user.info.company &&
  • Company: {user.info.company}
  • }
  • Followers: {user.info.followers}
  • Following: {user.info.following}
  • Public Repos: {user.info.public_repos}
  • {user.info.blog &&
  • Blog: {user.info.blog}
  • }
    ); }; UserDetails.propTypes = { score: PropTypes.number, info: PropTypes.shape({ avatar_url: PropTypes.string.isRequired, blog: PropTypes.string, company: PropTypes.string, followers: PropTypes.number.isRequired, following: PropTypes.number.isRequired, location: PropTypes.string, login: PropTypes.string.isRequired, name: PropTypes.string, public_repos: PropTypes.number.isRequired }) }; export default UserDetails;