import { defineStore } from 'pinia'

export const useUuidStore = defineStore('uuid', {
  state: () => ({
    uuid: null as string | null
  }),
  
  getters: {
    getUuid: (state) => state.uuid,
    hasUuid: (state) => !!state.uuid
  },
  
  actions: {
    setUuid(uuid: string) {
      this.uuid = uuid
    },
    
    clearUuid() {
      this.uuid = null
    }
  },
  
  persist: {
    enabled: true,
    strategies: [
      {
        key: 'uuid-store',
        storage: localStorage
      }
    ]
  }
}) 