Skip to content

Instantly share code, notes, and snippets.

@koss-lebedev
Last active October 10, 2022 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koss-lebedev/e3eefed14b157f5022e8286796948616 to your computer and use it in GitHub Desktop.
Save koss-lebedev/e3eefed14b157f5022e8286796948616 to your computer and use it in GitHub Desktop.
const Message = ({ text, imageUrl, audioUrl }) => {
if (audioUrl) {
return (
<div>
<audio controls>
<source src={audioUrl} />
</audio>
</div>
)
}
return (
<div>
{imageUrl && <img src={imageUrl} />}
{text && <p>{text}</p>}
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment