import React, { useRef, useState } from 'react'; import { SmilePlus } from 'lucide-react'; import { EmojiPickerModal } from '../features/workspace/EmojiPickerModal'; interface EmojiIconButtonProps { value: string; // "" = no icon (removed in the picker) onChange: (emoji: string) => void; } // Icon field of the create dialogs (note, task list, list): the emoji as a button that opens the same // picker as the icon of an open note, removing included (Doku/ui-patterns.md). export const EmojiIconButton: React.FC = ({ value, onChange }) => { const buttonRef = useRef(null); const [anchor, setAnchor] = useState(null); return ( <> {anchor && ( { onChange(emoji); setAnchor(null); }} onClose={() => setAnchor(null)} /> )} ); };