'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'; import { cn } from '@/lib/utils'; interface Props { readonly item: InsertPaletteItem; readonly iconOnly?: boolean; readonly popoverSide?: 'bottom' | 'right'; } /** * Single insert-palette button. Reused by both the (legacy) CommandBar * insert slot and the FloatingInsertToolbar at the canvas's left edge. * * 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()} ); }