td2-visualizer/src/components/map/object-renderers/IsolationIdRenderer.jsx
izawartka c688e67281 Migrate to Vite
- Migrated the codebase from create-react-app to Vite
2026-08-12 17:19:17 +02:00

21 lines
520 B
JavaScript

import SimpleLabelText from "../text/SimpleLabelText";
export default function IsolationIdRenderer(props) {
const { object } = props;
const text = object.id_isolation ?? '';
if (!text) return null;
let pos = (object.type === 'Switch' ? object.isolation_id_pos : object.points.middle) ?? object.pos;
const [x, y] = pos.toSVGCoords();
return (<SimpleLabelText
text={text}
x={x}
y={y}
textProps={{
className: "isolation-id-text"
}}
/>);
}