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

export const useGlobalDataStore = defineStore('globalDataStore', () => {
  const customerTips = ref<Record<string, any>[]>([])
  const ilList = ref<Record<string, any>[]>([])
  const ilMapById = reactive<Record<string, Record<string, any>>>({})
  const ilMapByAd = reactive<Record<string, Record<string, any>>>({})
  const ilcelerByIlId = reactive<Record<string, Record<string, any>[]>>({})
  const mahallelerByIlceId = reactive<Record<string, Record<string, any>[]>>({})
  const locationPerfStats = reactive({
    ilListCount: 0,
    ilListRequestMs: 0,
    ilceRequestMs: 0,
    mahalleRequestMs: 0
  })

  return {
    customerTips,
    ilList,
    ilMapById,
    ilMapByAd,
    ilcelerByIlId,
    mahallelerByIlceId,
    locationPerfStats
  }
})
