mirror of https://github.com/waku-org/js-waku.git
Remove unused component
This commit is contained in:
parent
ed5b7ba542
commit
329ed71fb6
|
@ -1,31 +0,0 @@
|
|||
import { useState } from 'react';
|
||||
|
||||
export interface Props {
|
||||
sendMessage: (message: string) => void;
|
||||
}
|
||||
function MessageInput(props: Props) {
|
||||
const [inputText, setInputText] = useState('');
|
||||
|
||||
const onChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
setInputText(event.target.value);
|
||||
};
|
||||
|
||||
const onKeyDown = (event: { key: string }) => {
|
||||
if (event.key === 'Enter') {
|
||||
props.sendMessage(inputText);
|
||||
setInputText('');
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Send a message...."
|
||||
onChange={onChange}
|
||||
onKeyDown={onKeyDown}
|
||||
value={inputText}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
Loading…
Reference in New Issue