feat: Enhance MapViewer with city detail and basic city components; integrate Pinia store for state management

This commit is contained in:
2026-01-16 16:51:35 +00:00
parent 4f44e76ef1
commit 5af2799662
6 changed files with 325 additions and 79 deletions
+26
View File
@@ -0,0 +1,26 @@
import { defineStore } from 'pinia';
interface MapViewerState {
showCityName: boolean;
detailMode: boolean;
hoveredCityId: number | null;
}
export const useMapViewerStore = defineStore('mapViewer', {
state: (): MapViewerState => ({
showCityName: true,
detailMode: false,
hoveredCityId: null,
}),
actions: {
toggleCityName() {
this.showCityName = !this.showCityName;
},
toggleDetailMode() {
this.detailMode = !this.detailMode;
},
setHoveredCity(cityId: number | null) {
this.hoveredCityId = cityId;
},
},
});