Guys look at the screen shot. I am building a chat window to show unread messages. Though it works fine. code window
and the output window
I just can't figure out a simple condition when the count is 0 I want to hide the entire badge.
<Badge
badgeContent={jobcard.jobcard_count.map(
(row2) => {
if (row2.jobcard_id === row._id)
return row2.count;
}
)}
color="primary"
>
<MailIcon />
</Badge>