title: how to use ternary operator for 3 conditions for fetching data from github api?
body: <p>I am trying to use ternary operators for 3 condition. I am getting data from github api using axios. First one isFetching it is used for fetching the data in which I will show a loading screen second one is used when the data is shown and the third one will be used to show an error message. I don't know how to put this in ternary operator or is there any other mistake I am doing ?</p>
  
  <p>Body.js </p>
  
  <pre><code>import React, {Component} from 'react';
  import {connect} from 'react-redux';
  import 'bootstrap/dist/css/bootstrap.css';
  
  class Body extends Component{
  
  render(){
      const { user, isFetching, error } =this.props;
      return(
          &lt;div&gt;
              {user.map((item,key) =&gt; {
                  return (
                      &lt;div key={key} className="card" &gt;
                          &lt;img className="card-img-top" src={item.data.avatar_url} alt="Card image cap"/&gt;
                          &lt;div className="card-body"&gt;
                              &lt;h5 className="card-title"&gt;{item.data.name}&lt;/h5&gt;
                              &lt;p className="card-text"&gt;{item.data.bio}&lt;/p&gt;
                          &lt;/div&gt;
                          &lt;ul className="list-group list-group-flush"&gt;
                              &lt;li className="list-group-item"&gt;{item.data.email}&lt;/li&gt;
                              &lt;li className="list-group-item"&gt;{item.data.location}&lt;/li&gt;
                              &lt;li className="list-group-item"&gt;{item.data.followers}&lt;/li&gt;
                          &lt;/ul&gt;
                          &lt;div className="card-body"&gt;
                              &lt;a href={item.url} className="card-link"&gt;Profile&lt;/a&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  )
              })}
  
          &lt;/div&gt;
  );
  }
  }
  function mapStateToProps(state) {
      return{
          user: state.user.user,
          isFetching: state.user.isFetching,
          error: state.user.error
      }
  }
  
  
  
  export default connect(mapStateToProps) (Body);
  </code></pre>