merge fix

This commit is contained in:
2025-03-27 09:06:26 +05:30
parent cc4d9d069b
commit 38ab556d17
11 changed files with 459 additions and 406 deletions

View File

@@ -44,34 +44,34 @@ const RealTimeVisulization: React.FC = () => {
const [zonesData, setZonesData] = useState<FormattedZoneData>({});
const { selectedZone, setSelectedZone } = useSelectedZoneStore();
// useEffect(() => {
// async function GetZoneData() {
// try {
// const response: { data: Zone[] } | undefined = await getZonesApi(
// "hexrfactory"
// );
useEffect(() => {
async function GetZoneData() {
try {
const response: { data: Zone[] } | undefined = await getZonesApi(
"hexrfactory"
);
// if (!response || !response.data) {
// return;
// }
// const formattedData = response?.data?.reduce<FormattedZoneData>(
// (acc, zone) => {
// acc[zone.zoneName] = {
// activeSides: [],
// panelOrder: [],
// lockedPanels: [],
// zoneCentrePoint: [],
// widgets: [],
// };
// return acc;
// },
// {}
// );
// setZonesData(formattedData);
// } catch (error) { }
// }
// GetZoneData();
// }, []);
if (!response || !response.data) {
return;
}
const formattedData = response?.data?.reduce<FormattedZoneData>(
(acc, zone) => {
acc[zone.zoneName] = {
activeSides: [],
panelOrder: [],
lockedPanels: [],
zoneCentrePoint: [],
widgets: [],
};
return acc;
},
{}
);
setZonesData(formattedData);
} catch (error) { }
}
GetZoneData();
}, []);
useEffect(() => {