import { computed } from 'vue';
import { usePlayerHome } from './usePlayerHome';

/** 玩家端站内邮箱功能开关（来自 /player/home） */
export function useInboxFeature() {
  const { homeRaw } = usePlayerHome();

  const inboxEnabled = computed(() => homeRaw.value?.inboxEnabled !== false);

  const hubRoute = computed(() =>
    inboxEnabled.value ? '/messages' : '/messages?tab=support',
  );

  const hubOpenLabelKey = computed(() =>
    inboxEnabled.value ? 'inbox_hub.open' : 'inbox_hub.open_support',
  );

  const hubTitleKey = computed(() =>
    inboxEnabled.value ? 'inbox_hub.title' : 'inbox_hub.tab_support',
  );

  return { inboxEnabled, hubRoute, hubOpenLabelKey, hubTitleKey };
}
