import React from "react" import * as antd from "antd" import { Icons } from "components/Icons" import { User } from "models" import classnames from "classnames" import "./index.less" const maxMessageLength = 512 const PostCreatorInput = (props) => { const [value, setValue] = React.useState("") const canPublish = () => { return value.length !== 0 && value.length < maxMessageLength } const onChange = (e) => { setValue(e.target.value) } const handleSubmit = () => { if (canPublish()) { if (typeof props.onSubmit === "function") { props.onSubmit(value) } setValue("") } } return