Add tabs to aircraft popup

This commit is contained in:
nocnico
2025-04-21 01:22:48 +02:00
parent c6c0d3a6d5
commit 9209b78b89
2 changed files with 68 additions and 9 deletions

View File

@@ -51,6 +51,13 @@ interface MapStore {
elementId: number;
} | null;
setSearchPopup: (popup: MapStore["searchPopup"]) => void;
aircraftTabs: {
[aircraftId: string]: "home" | "fms" | "aircraft" | "mission" | "chat";
};
setAircraftTab: (
aircraftId: string,
tab: MapStore["aircraftTabs"][string],
) => void;
}
export const useMapStore = create<MapStore>((set, get) => ({
@@ -91,4 +98,12 @@ export const useMapStore = create<MapStore>((set, get) => ({
set((state) => ({
searchElements: elements,
})),
aircraftTabs: {},
setAircraftTab: (aircraftId, tab) =>
set((state) => ({
aircraftTabs: {
...state.aircraftTabs,
[aircraftId]: tab,
},
})),
}));