import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
import { useStorage, useDark, useToggle } from '@vueuse/core'

export const useSettingsStore = defineStore('settings', () => {
    const isDark = useDark()
    const toggleDark = useToggle(isDark)
    const firstOpen = useStorage('firstOpen', 1, localStorage)
    const showCS = ref(true)
    if (firstOpen.value !== 2) {
        firstOpen.value = 2
        isDark.value = true
    }
    const toggleCS = useToggle(showCS)
    return { isDark, toggleDark, showCS, toggleCS }
})
