Skip to content

Instantly share code, notes, and snippets.

@koss-lebedev
Last active October 10, 2022 14:35
Show Gist options
  • Save koss-lebedev/f6d85a73c4e6d222dd6eea890426e051 to your computer and use it in GitHub Desktop.
Save koss-lebedev/f6d85a73c4e6d222dd6eea890426e051 to your computer and use it in GitHub Desktop.
const TextMessage = ({ text }) => {
return (
<div>
<p>{text}</p>
</div>
)
}
const ImageMessage = ({ text, imageUrl }) => {
return (
<div>
<img src={imageUrl} />
{text && <p>{text}</p>}
</div>
)
}
const AudioMessage = ({ audioUrl }) => {
return (
<div>
<audio controls>
<source src={audioUrl} />
</audio>
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment