import React, { useCallback, useRef } from 'react'; import { UncontrolledPopover } from 'reactstrap'; import classNames from 'classnames'; import Picker from '@emoji-mart/react'; import PropTypes from 'prop-types'; import { gettext } from '../../../utils/constants'; import { data } from './../utils/emoji-utils'; const PageIcon = ({ currentPageConfig, onUpdatePage }) => { const popoverRef = useRef(null); const handleSetIcon = useCallback((emoji) => { onUpdatePage(currentPageConfig.id, { name: currentPageConfig.name, icon: emoji }); setTimeout(() => { popoverRef.current?.toggle(); }, 300); }, [currentPageConfig.id, currentPageConfig.name, onUpdatePage]); const handleIconRemove = useCallback(() => { handleSetIcon(''); }, [handleSetIcon]); return ( <>