import type { AppStore } from "@editor/store"; import type { ViewportState } from "@editor/state"; import { PanControls } from "./bottom-controls/PanControls"; import { TransformControls } from "./bottom-controls/TransformControls"; import { ZoomControls } from "./bottom-controls/ZoomControls"; import type { Rect } from "@core/geometry"; import type { TransformTarget } from "@editor/transform"; export type BottomControlsAction = "pan" | "zoom"; export type BottomControlsIslandProps = { viewport: ViewportState; visible: boolean; action: BottomControlsAction; transformBounds?: Rect; transformTarget?: TransformTarget; dispatch: AppStore["dispatch"]; }; export function BottomControlsIsland({ viewport, visible, action, transformBounds, transformTarget, dispatch }: BottomControlsIslandProps) { const zoomPercent = Math.round(viewport.zoom * 100); const x = Math.round(viewport.center.x); const y = Math.round(viewport.center.y); return (
{transformBounds && transformTarget ? ( ) : action === "pan" ? ( ) : ( )}
); }