import { useEffect, useState } from 'react'; import { Box, Typography } from '@mui/material'; import { Picker } from 'emoji-mart'; const EmojiPicker = props => { const [selectedEmoji, setSelectedEmoji] = useState(); const [isShowPicker, setIsShowPicker] = useState(false); useEffect(() => { setSelectedEmoji(props.icon); }, [props.icon]); const selectEmoji = e => {}; const showPicker = () => setIsShowPicker(!isShowPicker); return ( variant='h3' fontWeight='700' sx={{ display: 'inline' }} onClick={showPicker} > {selectedEmoji} sx={{ display: isShowPicker ? 'block' : 'none', position: 'absolute', top: '100%', zIndex: '9999', }} > theme='dark' onSelect={selectEmoji} showPreview={false} /> ); }; export default EmojiPicker;