Remove unused component

This commit is contained in:
Franck Royer 2021-06-16 11:05:19 +10:00
parent ed5b7ba542
commit 329ed71fb6
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 0 additions and 31 deletions

View File

@ -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>
);
}