export const updateWifiData = (wifiData: any, nodes: any)=>{ const wifiName = wifiData.name; const updatedNodes = nodes.map((node: any) => { if (node.data.networkData && node.data.networkData.device === wifiName) { return { ...node, data: { ...node.data, networkData: { ...node.data.networkData, strength: wifiData.strength, }, }, }; } return node; }); return updatedNodes }