/** * WireInProgressRenderer — live preview while drawing a wire. * Shows the fixed waypoints + a dynamic elbow segment to the mouse cursor. */ import React from 'react'; import type { WireInProgress } from '../../types/wire'; import { generatePreviewPath, generateOrthogonalPath } from '../../utils/wireUtils'; interface Props { wireInProgress: WireInProgress; } export const WireInProgressRenderer: React.FC = ({ wireInProgress }) => { const { startEndpoint, waypoints, color, currentX, currentY } = wireInProgress; const path = generatePreviewPath( { x: startEndpoint.x, y: startEndpoint.y }, waypoints, currentX, currentY, ); if (!path) return null; return ( {/* Dark outline */} {/* Colored wire */} {/* Dashed overlay to indicate "in progress" */} {/* Start pin marker */} {/* Waypoint markers (locked-in corners) */} {waypoints.map((wp, i) => ( ))} {/* Cursor marker */} ); };