import React, { useRef, useEffect } from 'react'; import Picker from '@emoji-mart/react'; import data from '@emoji-mart/data'; interface EmojiPickerProps { onEmojiSelect: (emoji: { native: string }) => void; } export function EmojiPicker({ onEmojiSelect }: EmojiPickerProps) { const containerRef = useRef(null); // Prevent keyboard events from bubbling out (e.g. Enter submitting the chat input) useEffect(() => { const el = containerRef.current; if (!el) return; const stop = (e: KeyboardEvent) => e.stopPropagation(); el.addEventListener('keydown', stop); return () => el.removeEventListener('keydown', stop); }, []); return (
); }