import { ref } from "vue";

const activePanel = ref("");
const showSidebar = ref(false);
const focusMode = ref(false);
const fabOpen = ref(false);

function openPanel(name) {
  activePanel.value = name;
  fabOpen.value = false;
}

function closeOverlay() {
  activePanel.value = "";
}

function toggleSidebar() {
  showSidebar.value = !showSidebar.value;
}

function toggleFocus() {
  focusMode.value = !focusMode.value;
}

export function useUI() {
  return {
    activePanel,
    showSidebar,
    focusMode,
    fabOpen,
    openPanel,
    closeOverlay,
    toggleSidebar,
    toggleFocus,
  };
}
