MCPcopy Create free account
hub / github.com/Okabe-Rintarou-0/BookStore-Frontend / CommentInput

Function CommentInput

src/components/comment_input.jsx:5–22  ·  view source on GitHub ↗
({ placeholder, onSubmit, autoFocus })

Source from the content-addressed store, hash-verified

3const { TextArea } = Input;
4
5export default function CommentInput({ placeholder, onSubmit, autoFocus }) {
6 const handleSubmit = () => {
7 onSubmit?.(text);
8 setText('');
9 }
10
11 const [text, setText] = useState('');
12
13 return <Space direction="vertical" style={{ width: "100%" }}>
14 <TextArea autoFocus={autoFocus} placeholder={placeholder}
15 value={text}
16 onChange={e => setText(e.target.value)}
17 />
18 <Row justify="end">
19 <Col><Button type="primary" onClick={handleSubmit}>发布</Button></Col>
20 </Row>
21 </Space>
22}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected