import { useState, useRef } from "react"; import { SmilePlus, X } from "lucide-react"; import { Button } from "@/client/components/ui/button"; import { DropdownPortal } from "@/client/components/ui/dropdown-portal"; import { EmojiPicker } from "@/client/components/ui/emoji-picker"; import { EmojiIcon } from "@/client/components/ui/emoji-icon"; export function IconPicker({ currentIcon, onSelect, disabled = false, title, }: { currentIcon: string | null; onSelect: (icon: string | null) => void; disabled?: boolean; title?: string; }) { const [open, setOpen] = useState(false); const triggerRef = useRef(null); return ( <> {currentIcon ? (
) : ( )} {open && !disabled && ( setOpen(false)} className="border-0 bg-transparent shadow-none" > { onSelect(emoji); setOpen(false); }} /> )} ); }