I have react component the loop through data. I need to check add ClassName dynamically based on one of the field '{stateItem.transactionCoverStatus}' value.
Let's say if transactionCoverStatus == x then color-blue else if == y then color-red.. and so on.
There are about 5 possible values so also wonder if I can calculate in separate method which takes parameter and return class name!
<tbody>
{
eziTransactionCollection.map((stateItem, stateIndex) =>(
<tr key={stateIndex}>
<td className="td-align-centre">{stateItem.eziTransactionId}</td>
<td>{stateItem.transactionCoverStatus}</td>
<td>{stateItem.loginDateTime}</td>
<td>{stateItem.logoutDateTime}</td>
</tr>
))