/*
 * @Author: chris
 * @Date: 2025-08-12 15:33:59
 * @LastEditors: chris
 * @LastEditTime: 2025-08-12 15:34:26
 */
import useSettingsStore from "@/store/modules/settings";

/**
 * 封装设置相关的计算属性和方法
 * @returns {Object} 包含设置相关的计算属性
 */
export function useSettings() {
  const settingsStore = useSettingsStore();

  // 是否显示标签页
  const hasTags = computed(() => settingsStore.tagsView);

  // 是否显示顶部导航
  const hasTopNav = computed(() => settingsStore.topNav);

  // 是否固定头部
  const hasFixedHeader = computed(() => settingsStore.fixedHeader);

  // 是否显示侧边栏Logo
  const hasSidebarLogo = computed(() => settingsStore.sidebarLogo);

  // 是否启用动态标题
  const hasDynamicTitle = computed(() => settingsStore.dynamicTitle);

  // 切换暗黑模式
  const toggleDarkMode = () => {
    settingsStore.toggleTheme();
  };

  return {
    hasTags,
    hasTopNav,
    hasFixedHeader,
    hasSidebarLogo,
    hasDynamicTitle,
    toggleDarkMode,
  };
}
