mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
22 lines
506 B
TypeScript
22 lines
506 B
TypeScript
import { Form } from 'react-final-form';
|
|
|
|
import { InputAction } from '@app/components';
|
|
|
|
interface SayMessageProps {
|
|
onSubmit: (args: { message: string }) => void;
|
|
}
|
|
|
|
const SayMessage = ({ onSubmit }: SayMessageProps) => (
|
|
<Form onSubmit={onSubmit}>
|
|
{({ handleSubmit, form }) => (
|
|
<form onSubmit={e => {
|
|
handleSubmit(e);
|
|
form.restart();
|
|
}}>
|
|
<InputAction action="Send" label="Chat" name="message" />
|
|
</form>
|
|
)}
|
|
</Form>
|
|
);
|
|
|
|
export default SayMessage;
|