import * as React from "react" import { Edge, Corner } from "types" import { useSelector } from "state" import { getSelectedShapes, isMobile } from "utils/utils" import CenterHandle from "./center-handle" import CornerHandle from "./corner-handle" import EdgeHandle from "./edge-handle" import RotateHandle from "./rotate-handle" export default function Bounds() { const isBrushing = useSelector((s) => s.isIn("brushSelecting")) const isSelecting = useSelector((s) => s.isIn("selecting")) const zoom = useSelector((s) => s.data.camera.zoom) const bounds = useSelector((s) => s.values.selectedBounds) const rotation = useSelector(({ data }) => data.selectedIds.size === 1 ? getSelectedShapes(data)[0].rotation : 0 ) if (!bounds) return null if (!isSelecting) return null const size = (isMobile().any ? 16 : 8) / zoom // Touch target size return ( ) }