import { Eraser, PaintBrush } from "@phosphor-icons/react"; import { commandIds } from "@commands/ids"; import type { AppStore } from "@editor/store"; import type { MaskViewMode } from "@editor/state"; import type { BrushSettings, ToolId } from "@editor/tools"; import { BottomControlColorPicker } from "./ColorPicker"; import { BottomControlDivider } from "./Divider"; import { BottomControlSelectMenu, type BottomControlSelectOption } from "./SelectMenu"; import { BottomControlSlider } from "./Slider"; import { bottomControlFieldClass, bottomControlIconSlotClass, bottomControlLabelClass, bottomControlMenuClass } from "./styles"; export type BrushControlsProps = { tool: Extract; settings: BrushSettings; editingMask?: boolean; maskViewMode?: MaskViewMode; dispatch: AppStore["dispatch"]; }; const maskViewModeOptions = [ { value: "composite", label: "Image" }, { value: "blackWhite", label: "B/W" }, { value: "alpha", label: "Alpha" }, { value: "overlay", label: "Overlay" }, ] satisfies readonly BottomControlSelectOption[]; export function BrushControls({ tool, settings, editingMask = false, maskViewMode = "composite", dispatch }: BrushControlsProps) { return (
{tool === "eraser" ? : } {tool === "brush" && !editingMask ? ( ) : null} {editingMask ? ( <> ) : null}
); }