import { Line } from 'react-konva';

interface CableRouteSymbolProps {
  /** Flat array of [x1,y1, x2,y2, ...] in screen coordinates. */
  readonly points: readonly number[];
  readonly color: string;
  readonly isSelected: boolean;
}

/** IEC cable route: dashed line connecting elements. */
export function CableRouteSymbol({ points, color, isSelected }: CableRouteSymbolProps) {
  return (
    <Line
      points={points as number[]}
      stroke={isSelected ? '#4c6ef5' : color}
      strokeWidth={isSelected ? 2.5 : 2}
      dash={[8, 4]}
      lineCap="round"
      lineJoin="round"
      listening={false}
    />
  );
}
