MCPcopy Create free account
hub / github.com/cartesiancs/map3d / App

Function App

src/ui/App.tsx:34–303  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32`;
33
34function App() {
35 const [isNextButtonDisabled, setIsNextButtonDisabled] = useState(true);
36 const [areaData, setAreaData] = useState([]);
37 const [steps, setSteps] = useState(["front", "processing"]);
38 const [step, setStep] = useState(0);
39 const [isWarnModal, setIsWarnModal] = useState(false);
40 const [isExportModal, setIsExportModal] = useState(false);
41 const [isFleetLogin, setIsFleetLogin] = useState(false);
42 const [isFleetModal, setIsFleetModal] = useState(false);
43 const [spaceList, setSpaceList] = useState([]);
44 const [buildings, setBuildings] = useState<Building[]>([]);
45 const [isFetchingBuildings, setIsFetchingBuildings] = useState(false);
46 const [hasFetchedBuildings, setHasFetchedBuildings] = useState(false);
47
48 const setCenter = useAreaStore((state) => state.setCenter);
49 const appendAreas = useAreaStore((state) => state.appendAreas);
50 const setAction = useActionStore((state) => state.setAction);
51 const setFleet = useActionStore((state) => state.setFleet);
52
53 const checkIsBig = () => {
54 const a = areaData[0].lat - areaData[1].lat;
55 const b = areaData[0].lng - areaData[1].lng;
56
57 console.log(a + b);
58
59 if (a + b > 0.1) {
60 return true;
61 } else {
62 return false;
63 }
64 };
65
66 const exportFile = () => {
67 setAction(true);
68 };
69
70 const exportFleet = () => {
71 setAction(true);
72 };
73
74 const getFleetSpaces = async () => {
75 const getSpace: any = await instanceFleet.get("space");
76
77 setSpaceList([
78 ...getSpace.data.spaces.map((item) => {
79 return {
80 ...item,
81 key: item.id,
82 };
83 }),
84 ]);
85 };
86
87 const putGlbOnFleetSpace = (spaceId) => {
88 setFleet(spaceId, "fleet");
89 setTimeout(() => {
90 exportFleet();
91 }, 100);

Callers

nothing calls this directly

Calls 2

checkFleetLoginFunction · 0.85
putGlbOnFleetSpaceFunction · 0.85

Tested by

no test coverage detected