import { useState } from 'react' import PropTypes from 'prop-types' function InputBar({ onSend }) { const [text, setText] = useState('') const handleSubmit = (e) => { e.preventDefault() if (!text.trim()) return onSend(text) setText('') } return (
) } InputBar.propTypes = { onSend: PropTypes.func.isRequired, } export default InputBar