I am fetching JSON data from an API and then need to display it in a react component. I need to use if/else conditions. For ex. The duration returned by the JSON data might turn out to be 0 or it might not be set at all, in that case, I need to avoid displaying it on the screen. So I need an if/else conditioning inside the row class and display Duration data only if it is being provided by the API, how can I achieve that? I read that JSX doesn't support if/else, what's the alternative in that case?
<div className="row">
//if condition needs to go here
<div className="__section--left">Duration</div>
<div className="__section--right border">
{item.durationHours} Hours
{item.durationMinutes} Minutes
</div>
</div>