In a React project, I have JSON data as follows
const data = [
{ id: '123abc', comment: 'How are you?' },
{ id: '234abc', comment: 'https://flower.jpg' },
{ id: '123xyz', comment: 'Whatsupp?' },
{ id: '335sde', comment: 'https://galaxy.png' },
];
I'am trying as under
<div>
{/* For images */}
<img src={data.comment} height="50px"/>
{/* For text */}
<Typography variant="caption">
{data.comment}
</Typography>
</div>
As seen above some comments are text whereas some are images. So, how to render it? Any appropriate solution highly appreciated