You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1000 B
JavaScript
32 lines
1000 B
JavaScript
import { useState } from 'react';
|
|
import { Popover, Button } from 'antd';
|
|
import EmojiPicker from 'emoji-picker-react';
|
|
|
|
const InputTemplate = ({ mobile, disabled = false, inputEmoji }) => {
|
|
const [openPopup, setOpenPopup] = useState(false);
|
|
|
|
const handlePickEmoji = (emojiData) => {
|
|
inputEmoji(emojiData.emoji);
|
|
};
|
|
|
|
return (
|
|
<>
|
|
<Popover
|
|
overlayClassName='p-0'
|
|
placement={mobile === undefined ? 'right' : 'top'}
|
|
overlayInnerStyle={{ padding: 0, borderRadius: '8px' }}
|
|
forceRender={true}
|
|
content={<EmojiPicker skinTonesDisabled={true} emojiStyle='native' onEmojiClick={handlePickEmoji} className='chatwindow-wrapper' />}
|
|
// title='😃'
|
|
trigger='click'
|
|
open={openPopup}
|
|
onOpenChange={setOpenPopup}>
|
|
<Button type='text' className=' px-1' size={'middle'} disabled={disabled}>
|
|
😃
|
|
</Button>
|
|
</Popover>
|
|
</>
|
|
);
|
|
};
|
|
export default InputTemplate;
|