Add initial JSON data files and implement core page components for game functionality

This commit is contained in:
bobbert committed 2026-03-17 21:49:44 +00:00
1 parent 81847a9188
commit ca27f8d6ed
54 files changed
+2424 -250

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
import { useEffect, useState } from 'react';
import { getMapPoints } from '../API/API';
import { getSession } from '../Model/SessionStore';
const useMapViewModel = (groupId = null) => {
const [points, setPoints] = useState([]);
const { currentGid, currentSGid } = getSession();
const resolvedGid = groupId ?? currentGid;
useEffect(() => {
if (!resolvedGid) {
setPoints([]);
return;
}
let active = true;
getMapPoints(resolvedGid, currentSGid).then((payload) => {
if (active) {
setPoints(payload);
}
});
return () => {
active = false;
};
}, [resolvedGid, currentSGid]);
return { points };
};
export default useMapViewModel;