import { InterstellarMap } from "@thorium/components/Starmap/InterstellarMap"; import { StarmapShip } from "@thorium/components/Starmap/StarmapShip"; import { useGetStarmapStore } from "@thorium/components/Starmap/starmapStore"; import SystemMarker from "@thorium/components/Starmap/SystemMarker"; import { WaypointEntity } from "@thorium/components/Starmap/WaypointEntity"; import { q } from "@thorium/context/AppContext"; import { useStation } from "@thorium/routes/station/useStation"; import { Suspense, useEffect } from "react"; import { ErrorBoundary } from "react-error-boundary"; export function InterstellarWrapper() { const { shipId } = useStation(); const useStarmapStore = useGetStarmapStore(); // This netRequest comes from the starmap core. const [starmapSystems] = q.starmapCore.systems.useNetRequest(); const [ship] = q.navigation.ship.useNetRequest({ shipId }); const [waypoints] = q.waypoints.all.useNetRequest({ systemId: null, active: false, shipId, }); const [autopilot] = q.pilot.autopilot.get.useNetRequest({ shipId }); useEffect(() => { useStarmapStore.getState().currentSystemSet?.(null); }, [useStarmapStore]); return ( {starmapSystems.map((sys) => sys.position && sys.identity ? ( { useStarmapStore.setState({ selectedObjectIds: [sys.id] }); }} onDoubleClick={() => { useStarmapStore.getState().setCurrentSystem(sys.id); useStarmapStore.setState({ selectedObjectIds: [] }); }} commSatelliteRadius={null} /> ) : null, )} {ship.position?.parentId === null && ( <>} onError={(err) => console.error(err)}> )} {waypoints.map((waypoint) => ( <>} onError={(err) => console.error(err)}> ))} ); }