'use client';
import { Fragment } from 'react';
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
import type { FloatingAction } from '@/lib/edit/scene-editor-surface';
interface FloatingToolbarProps {
readonly actions: readonly FloatingAction[];
}
/**
* Contextual mini-bar shown above the canvas when something is selected.
* Each action is either a button (onInvoke) or a popover trigger
* (popoverContent) — used by the slide surface for color pickers, font
* select, etc. so properties live here instead of in a fixed right panel.
*/
export function FloatingToolbar({ actions }: FloatingToolbarProps) {
if (actions.length === 0) return null;
const grouped = groupByGroup(actions);
return (