Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save GuillaumeDaviid/5290a5a59b311175d5f831b55a44f643 to your computer and use it in GitHub Desktop.

Select an option

Save GuillaumeDaviid/5290a5a59b311175d5f831b55a44f643 to your computer and use it in GitHub Desktop.
list message - claude 3
const listMsg = countMsg > 0 ?
(msg.me.map((item, key) => <div className='chat_bot_content-msg'><h2 className='chat_bot-msg'>Moi :</h2><p className='chat_bot-msg' key={item.key}>{item}</p>
<h2 className='chat_bot-msg'>Bot :</h2> {msg.bot[key]}</div>))
: (<p></p>)
return (
<div>
<h1 className='title'>Chat Bot</h1>
<div className="chat_bot" id="chat_bot">
<div className='chat_bot_content-msg' id='chat_bot_content-msg'>
<h2 className='chat_bot-msg'>Bot :</h2>
<p className='chat_bot-msg'>Bonjour, Je suis un bot codé avec React.js</p>
</div>
{listMsg}
</div>
<form className='form'>
<input className='msg' id="msg" placeholder='Message' value={newMsg} onChange={handleChange}></input>
<button className='btn' onClick={handleClick}>Envoyer</button>
</form>
</div>
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment