mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 11:17:49 +01:00
28 lines
561 B
TypeScript
28 lines
561 B
TypeScript
import * as React from 'react';
|
|
import { FormEvent } from 'react';
|
|
|
|
import Button from '../shared/Button';
|
|
|
|
interface Props {
|
|
body: string;
|
|
parentId: number;
|
|
handleChange(e: FormEvent): void;
|
|
handleSubmit(body: string, parentId: number): void;
|
|
}
|
|
|
|
const NewComment = ({
|
|
body,
|
|
parentId,
|
|
handleChange,
|
|
handleSubmit,
|
|
}: Props) => (
|
|
<div className="newCommentForm">
|
|
<textarea
|
|
value={body}
|
|
onChange={handleChange}
|
|
/>
|
|
<Button onClick={() => handleSubmit(body, parentId)}>Submit</Button>
|
|
</div>
|
|
);
|
|
|
|
export default NewComment; |