I'm attempting to modify the color of a card depending on the current slot value, which is an object in an array. While I am iterating through each card, I want to adjust the background color of the card based on this value. However, my current method does not appear to be working as expected. Any suggestions on how I can achieve this?
slots.map(slot =>
<Card key ={slot._id} style={{backgroundColor:slot.OccupiedStatus?'black':'teal'}}>
<Typography>{slot.category}</Typography>
</Card>