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

export const useUIStore = defineStore('ui', () => {
  const isSidebarOpen = ref(false)
  const pageTitle = ref('')

  const toggleSidebar = () => {
    isSidebarOpen.value = !isSidebarOpen.value
  }

  const setSidebarState = (open) => {
    isSidebarOpen.value = open
  }

  const setPageTitle = (title) => {
    pageTitle.value = title
  }

  return {
    isSidebarOpen,
    pageTitle,
    toggleSidebar,
    setSidebarState,
    setPageTitle,
  }
})
