feat: Enhance MapViewer with city detail and basic city components; integrate Pinia store for state management
This commit is contained in:
@@ -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;
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user