I have a component called Card, then I want to add a condition if the data = 0 return the first image, otherwise return the second image, more details can be seen below:
{data?.data?.map((dataVote: any, i: number) => (
<Card
//i want to add below if else condition
(if data == 0)
return(image={'/static/images/image-10.png'})
//else
return(image={'/static/images/image-22.png'})
name={dataVote.attributes.nama}
title={dataVote.attributes.deskripsi}
user={dataVote.attributes.sosmed}
onClick={() => {
setOpen(true)
fetchProvince()
fetchProfession()
fetchId(dataVote?.id)
}}
key={i}></Card>
))}