import { useGetStarmapStore } from "@thorium/components/Starmap/starmapStore"; import { q } from "@thorium/context/AppContext"; import { useStation } from "@thorium/routes/station/useStation"; import Button from "@thorium/ui/Button"; import { ZoomSlider } from "@thorium/ui/Slider"; import { useEffect } from "react"; export function MapControls() { const { shipId } = useStation(); const useStarmapStore = useGetStarmapStore(); const systemId = useStarmapStore((state) => state.currentSystem); const [ship] = q.navigation.ship.useNetRequest({ shipId }); useEffect(() => { q.navigation.ship.netRequest({ shipId }).then((res) => { useStarmapStore.setState({ followEntityId: res.id }); }); }, [useStarmapStore, shipId]); useEffect(() => { if (useStarmapStore.getState().followEntityId === ship.id) { useStarmapStore.getState().setCurrentSystem(ship.position?.parentId || null); } }, [ship.position?.parentId, useStarmapStore, ship.id]); return (
Zoom: