import classNames from 'classnames'; import React from 'react'; import { Emoji, HStack } from 'soapbox/components/ui'; interface IEmojiButton { /** Unicode emoji character. */ emoji: string, /** Event handler when the emoji is clicked. */ onClick: React.EventHandler, /** Extra class name on the ); }; interface IEmojiSelector { /** List of Unicode emoji characters. */ emojis: Iterable, /** Event handler when an emoji is clicked. */ onReact: (emoji: string) => void, /** Whether the selector should be visible. */ visible?: boolean, /** Whether the selector should be focused. */ focused?: boolean, } /** Panel with a row of emoji buttons. */ const EmojiSelector: React.FC = ({ emojis, onReact, visible = false, focused = false }): JSX.Element => { const handleReact = (emoji: string): React.EventHandler => { return (e) => { onReact(emoji); e.preventDefault(); e.stopPropagation(); }; }; return ( {Array.from(emojis).map((emoji, i) => ( ))} ); }; export default EmojiSelector;