import { defineStore } from "pinia";

interface LocationData {
  latitude: number;
  longitude: number;
}

export const useLocationStore = defineStore("location", {
  state() {
    return {
      latitude: 0, // 纬度
      longitude: 0, // 经度
    };
  },

  actions: {
    setLocationData(data: LocationData) {
      this.latitude = data.latitude;
      this.longitude = data.longitude;
    },
  },

  unistorage: true,
});
