import { useEffect } from 'react' import GeschossDialog from './components/GeschossDialog' import { notifyReady } from './lib/rhinoBridge' function bridgeSend(type, payload = {}) { if (!window.RHINO_MODE) { console.log('[Bridge] →', type, payload); return } const json = JSON.stringify({ type, payload }) document.title = 'RHINOMSG::' + json } // recalcOkff direkt hier — gleiche Logik wie in ZeichnungsebenenApp.jsx, // damit der Dialog die OKFF-Werte beim Editieren live updaten kann. function recalcOkff(list) { let acc = 0 return list.map(z => { if (z.isGeschoss) { const next = { ...z, okff: parseFloat(acc.toFixed(3)) } acc += (z.hoehe ?? 3.0) return next } return { ...z, okff: undefined } }) } export default function GeschossDialogApp() { const initial = (typeof window !== 'undefined' && window.PANEL_PARAMS) || {} useEffect(() => { notifyReady() const blockContext = (ev) => ev.preventDefault() document.addEventListener('contextmenu', blockContext) return () => document.removeEventListener('contextmenu', blockContext) }, []) const z = initial.zeichnungsebenen || initial if (!Array.isArray(z) || z.length === 0) { return
Keine Daten
} return ( bridgeSend('SAVE', { zeichnungsebenen: updated })} onClose={() => bridgeSend('CANCEL', {})} /> ) }