import {defineStore} from 'pinia'
import {ref} from 'vue'

export const useNavStore = defineStore(
  'nav',
  () => {
    const navIndex = ref('/')

    const changeNavIndex = (id) => {
      if (!id) {
        return
      } else {
        navIndex.value = id
      }
    }

    return {
      navIndex,
      changeNavIndex,
    }
  },
  {
    persist: true,
  }
)
