MCPcopy
hub / github.com/adrianhajdin/project_chat_application / Input

Function Input

client/src/components/Input/Input.js:5–17  ·  view source on GitHub ↗
({ setMessage, sendMessage, message })

Source from the content-addressed store, hash-verified

3import './Input.css';
4
5const Input = ({ setMessage, sendMessage, message }) => (
6 <form className="form">
7 <input
8 className="input"
9 type="text"
10 placeholder="Type a message..."
11 value={message}
12 onChange={({ target: { value } }) => setMessage(value)}
13 onKeyPress={event => event.key === 'Enter' ? sendMessage(event) : null}
14 />
15 <button className="sendButton" onClick={e => sendMessage(e)}>Send</button>
16 </form>
17)
18
19export default Input;

Callers

nothing calls this directly

Calls 1

sendMessageFunction · 0.85

Tested by

no test coverage detected