title: How to change bg color if condition in map function using jsx?
body: <p>i have an object of data where i want to change the color of a div on condition base </p>
  
  <pre><code> &lt;Col className="mainbody"&gt;                      
        {items.map(data =&gt; &lt;CardPanel className="location" 
                           key={data.parkingID}&gt;
                          &lt;div onClick={() =&gt; 
                            this.handleClick(data.parkingArea)} &gt;                                                     
                           {data.parkingArea}
                         {data.status == "booked" ? style="color changed to 
                                red" :style= "color changed to red"}
                        &lt;Icon&gt;directions_car&lt;/Icon&gt;                               
                          &lt;/div&gt;
                      &lt;/CardPanel&gt;)}
  </code></pre>
  
  <p>here in {data.status} i want to check the condition if status is "booked" then change bgcolor "red"  </p>