'use client'; import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'; import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'; import type { InsertPaletteItem } from '@/lib/edit/scene-editor-surface'; /** * Single insert-palette button. Reused by both the (legacy) CommandBar * insert slot and the FloatingInsertToolbar that lives above the * canvas now. * * When the item declares `popoverContent`, the button doubles as a * popover trigger — and PopoverTrigger's `asChild` Slot is chained * directly onto the real ` ); const triggerWithTooltip = ( {button} {item.tooltip && {item.tooltip}} ); if (!item.popoverContent) return triggerWithTooltip; return ( {button} {item.tooltip && {item.tooltip}} {item.popoverContent()} ); }