import { Cursor, Eraser, Hand, PaintBrush, DropHalf, MagicWand, Sparkle } from "@phosphor-icons/react"; import { commandIds } from "@commands/ids"; import type { AppStore } from "@editor/store"; import type { InteractionMode, OperationId, ToolId } from "@editor/tools"; import { availableOperationIds, availableToolIds } from "@editor/tools"; import { isOperationWorkspacePanel, type WorkspacePanel } from "@editor/state"; import { labelForTool } from "./toolLabels"; export type ToolOverlayProps = { activeTool: ToolId; interactionMode: InteractionMode; panel: WorkspacePanel; dispatch: AppStore["dispatch"]; }; export function ToolOverlay({ activeTool, interactionMode, panel, dispatch }: ToolOverlayProps) { return ( ); } function iconForTool(tool: ToolId) { switch (tool) { case "brush": return PaintBrush; case "eraser": return Eraser; case "magicWand": return MagicWand; case "pan": return Hand; case "select": return Cursor; } } function iconForOperation(operation: OperationId) { return operation === "generate" ? Sparkle : DropHalf; } function labelForOperation(operation: OperationId) { return operation === "generate" ? "Generate" : "Chroma key"; } function isToolHighlighted(tool: ToolId, activeTool: ToolId, interactionMode: InteractionMode) { if (interactionMode.type === "temporary-pan") return tool === "pan"; return activeTool === tool; } function buttonClass(active: boolean) { const base = "inline-flex size-9 items-center justify-center rounded-lg text-xs font-medium transition focus:outline-none focus-visible:ring-2 focus-visible:ring-sky-300/50"; return active ? `${base} bg-sky-300 text-slate-950` : `${base} text-white/55 hover:bg-white/[0.07] hover:text-white`; }