import React from "react"; interface DistanceLinesProps { obj: { position: { top?: number | "auto"; left?: number | "auto"; right?: number | "auto"; bottom?: number | "auto"; }; }; activeEdges: { vertical: "top" | "bottom"; horizontal: "left" | "right"; } | null; } const DistanceLines: React.FC = ({ obj, activeEdges }) => { if (!activeEdges) return null; return ( <> {activeEdges.vertical === "top" && typeof obj.position.top === "number" && (
{obj.position.top}px
)} {activeEdges.vertical === "bottom" && typeof obj.position.bottom === "number" && (
{obj.position.bottom}px
)} {activeEdges.horizontal === "left" && typeof obj.position.left === "number" && (
{obj.position.left}px
)} {activeEdges.horizontal === "right" && typeof obj.position.right === "number" && (
{obj.position.right}px
)} ); }; export default DistanceLines;