import React from "react"; import styles from "./TopologyBuilder.module.css"; import type { TopologyNode } from "./model"; import MachineSelector from "../../assets/Selector/MachineSelector"; import ModuleSlots from "../../assets/Selector/ModuleSlots"; import BeaconConfigurator, { type BeaconGroup } from "../../assets/Selector/BeaconConfigurator"; import { ContainerType } from "../simulator"; export default function NodeInspector({ node, onChange }: { node: TopologyNode; onChange: (n: TopologyNode) => void }) { const updateName = (e: React.ChangeEvent) => onChange({ ...node, name: e.target.value }); const updateMachineConfig = (updates: Partial) => { if (!node.machineConfig) return; onChange({ ...node, machineConfig: { ...node.machineConfig, ...updates }, }); }; return (

Edit {node.type}

{node.type === ContainerType.Machine && node.machineConfig && (
updateMachineConfig({ multiplier: parseInt(e.target.value, 10) || 1 })} />
updateMachineConfig({ setup: { ...node.machineConfig!.setup, machine: machine as any, machineQualityLevel: qualityLevel, }, recipe, }) } />
updateMachineConfig({ setup: { ...node.machineConfig!.setup, machineModules: modules }, }) } />
updateMachineConfig({ setup: { ...node.machineConfig!.setup, beacons }, }) } />
)}
); }