Added Dynamic Sidebar Title Logic

This commit is contained in:
2025-05-14 06:46:47 -06:00
parent 4f4f766b48
commit 059eda8b01
3 changed files with 42 additions and 5 deletions

View File

@ -52,6 +52,18 @@ export default function FlowEditor({
}) {
// Node Configuration Sidebar State
const [drawerOpen, setDrawerOpen] = useState(false);
const [selectedNodeLabel, setSelectedNodeLabel] = useState(null);
useEffect(() => {
window.BorealisOpenDrawer = (label) => {
setSelectedNodeLabel(label);
setDrawerOpen(true);
};
return () => {
delete window.BorealisOpenDrawer;
};
}, []);
const wrapperRef = useRef(null);
const { project } = useReactFlow();
@ -356,7 +368,11 @@ export default function FlowEditor({
ref={wrapperRef}
style={{ position: "relative" }}
>
<NodeConfigurationSidebar drawerOpen={drawerOpen} setDrawerOpen={setDrawerOpen} />
<NodeConfigurationSidebar
drawerOpen={drawerOpen}
setDrawerOpen={setDrawerOpen}
title={selectedNodeLabel}
/>
<ReactFlow
nodes={nodes}