Something went wrong. Try again.
Starship Simulator Controls thoriumsim.com
Something went wrong. Try again.
708 B · 30 lines
TSX
at develop
12345678910111213141516171819202122232425262728293031import { Icon } from "@thorium/ui/Icon";import { Tooltip } from "@thorium/ui/Tooltip";
import { useShipMapStore } from "./useShipMapStore";
export function GoToRoomButton({ decks, currentDeckIndex, selectedRoom,}: { decks: { name: string }[]; currentDeckIndex: number; selectedRoom: { deck: string | undefined };}) { const deckIndex = decks.findIndex((d) => d.name === selectedRoom.deck); if (deckIndex === currentDeckIndex) return null; return ( <Tooltip content="Go To Room"> <button className="cursor-pointer px-4" onClick={() => { useShipMapStore.setState({ deckIndex }); }} aria-label="Go To Room" > <Icon name="log-out" /> </button> </Tooltip> );}