import { Picker } from 'emoji-mart' import 'emoji-mart/css/emoji-mart.css' import React, { useState } from 'react' import { Input, Col, Button } from 'antd' import { SmileOutlined, SmileFilled, SendOutlined } from '@ant-design/icons' import { Link } from 'react-router-dom' const AddComment = ({ addComment, postId, style, width }) => { const [text, setComment] = useState('') const [showEmojiPicker, setShowEmojiPicker] = useState(false) const handleOK = () => setShowEmojiPicker(!showEmojiPicker) const addEmoji = ({ native }) => setComment((text + ' ' + native).trim()) return ( <> {showEmojiPicker && ( addEmoji(native)} /> )} { setComment(e.target.value) }} onPressEnter={(e) => setComment(e.target.value)} /> {!showEmojiPicker ? ( ) : ( )} {/* */} ) } export default AddComment