import { TabsThemeEnum, ContentEnum, RouterTransitionEnum } from '@/enums/appEnum';
import {
  MenuModeEnum,
  MenuTypeEnum,
  TopMenuAlignEnum,
  TriggerEnum,
  MixSidebarTriggerEnum,
} from '@/enums/menuEnum';
<%_ if (enableTranslation) { _%>

import { useI18n } from '@/hooks/web/useI18n';

const { t } = useI18n();
<%_ } _%>

export enum HandlerEnum {
  CHANGE_LAYOUT,
  CHANGE_THEME_COLOR,
  CHANGE_THEME,
  // menu
  MENU_HAS_DRAG,
  MENU_ACCORDION,
  MENU_TRIGGER,
  MENU_TOP_ALIGN,
  MENU_COLLAPSED,
  MENU_COLLAPSED_SHOW_TITLE,
  MENU_WIDTH,
  MENU_SHOW_SIDEBAR,
  MENU_THEME,
  MENU_SPLIT,
  MENU_FIXED,
  MENU_CLOSE_MIX_SIDEBAR_ON_CHANGE,
  MENU_TRIGGER_MIX_SIDEBAR,
  MENU_FIXED_MIX_SIDEBAR,

  // header
  HEADER_SHOW,
  HEADER_THEME,
  HEADER_FIXED,

  HEADER_SEARCH,

  TABS_SHOW_QUICK,
  TABS_SHOW_REDO,
  TABS_SHOW,
  TABS_SHOW_FOLD,
  TABS_THEME,

  LOCK_TIME,
  FULL_CONTENT,
  CONTENT_MODE,
  SHOW_BREADCRUMB,
  SHOW_BREADCRUMB_ICON,
  GRAY_MODE,
  COLOR_WEAK,
  SHOW_LOGO,
  SHOW_FOOTER,

  ROUTER_TRANSITION,
  OPEN_PROGRESS,
  OPEN_PAGE_LOADING,
  OPEN_ROUTE_TRANSITION,
}

// 标签页样式
export const tabsThemeOptions = [
  {
    value: TabsThemeEnum.SMOOTH,
    label: <% if (enableTranslation) { %>t('layout.setting.tabsThemeSmooth')<% } else { %>'t$t('layout.setting.tabsThemeSmooth')$t$'<% } %>,
  },
  {
    value: TabsThemeEnum.CARD,
    label: <% if (enableTranslation) { %>t('layout.setting.tabsThemeCard')<% } else { %>'t$t('layout.setting.tabsThemeCard')$t$'<% } %>,
  },
  {
    value: TabsThemeEnum.SIMPLE,
    label: <% if (enableTranslation) { %>t('layout.setting.tabsThemeSimple')<% } else { %>'t$t('layout.setting.tabsThemeSimple')$t$'<% } %>,
  },
];

export const contentModeOptions = [
  {
    value: ContentEnum.FULL,
    label: <% if (enableTranslation) { %>t('layout.setting.contentModeFull')<% } else { %>'t$t('layout.setting.contentModeFull')$t$'<% } %>,
  },
  {
    value: ContentEnum.FIXED,
    label: <% if (enableTranslation) { %>t('layout.setting.contentModeFixed')<% } else { %>'t$t('layout.setting.contentModeFixed')$t$'<% } %>,
  },
];

export const topMenuAlignOptions = [
  {
    value: TopMenuAlignEnum.CENTER,
    label: <% if (enableTranslation) { %>t('layout.setting.topMenuAlignRight')<% } else { %>'t$t('layout.setting.topMenuAlignRight')$t$'<% } %>,
  },
  {
    value: TopMenuAlignEnum.START,
    label: <% if (enableTranslation) { %>t('layout.setting.topMenuAlignLeft')<% } else { %>'t$t('layout.setting.topMenuAlignLeft')$t$'<% } %>,
  },
  {
    value: TopMenuAlignEnum.END,
    label: <% if (enableTranslation) { %>t('layout.setting.topMenuAlignCenter')<% } else { %>'t$t('layout.setting.topMenuAlignCenter')$t$'<% } %>,
  },
];

export const getMenuTriggerOptions = (hideTop: boolean) => {
  return [
    {
      value: TriggerEnum.NONE,
      label: <% if (enableTranslation) { %>t('layout.setting.menuTriggerNone')<% } else { %>'t$t('layout.setting.menuTriggerNone')$t$'<% } %>,
    },
    {
      value: TriggerEnum.FOOTER,
      label: <% if (enableTranslation) { %>t('layout.setting.menuTriggerBottom')<% } else { %>'t$t('layout.setting.menuTriggerBottom')$t$'<% } %>,
    },
    ...(hideTop
      ? []
      : [
          {
            value: TriggerEnum.HEADER,
            label: <% if (enableTranslation) { %>t('layout.setting.menuTriggerTop')<% } else { %>'t$t('layout.setting.menuTriggerTop')$t$'<% } %>,
          },
        ]),
  ];
};

export const routerTransitionOptions = [
  RouterTransitionEnum.ZOOM_FADE,
  RouterTransitionEnum.FADE,
  RouterTransitionEnum.ZOOM_OUT,
  RouterTransitionEnum.FADE_SIDE,
  RouterTransitionEnum.FADE_BOTTOM,
  RouterTransitionEnum.FADE_SCALE,
].map((item) => {
  return {
    label: item,
    value: item,
  };
});

export const menuTypeList = [
  {
    title: <% if (enableTranslation) { %>t('layout.setting.menuTypeSidebar')<% } else { %>'t$t('layout.setting.menuTypeSidebar')$t$'<% } %>,
    mode: MenuModeEnum.INLINE,
    type: MenuTypeEnum.SIDEBAR,
  },
  {
    title: <% if (enableTranslation) { %>t('layout.setting.menuTypeMix')<% } else { %>'t$t('layout.setting.menuTypeMix')$t$'<% } %>,
    mode: MenuModeEnum.INLINE,
    type: MenuTypeEnum.MIX,
  },

  {
    title: <% if (enableTranslation) { %>t('layout.setting.menuTypeTopMenu')<% } else { %>'t$t('layout.setting.menuTypeTopMenu')$t$'<% } %>,
    mode: MenuModeEnum.HORIZONTAL,
    type: MenuTypeEnum.TOP_MENU,
  },
  {
    title: <% if (enableTranslation) { %>t('layout.setting.menuTypeMixSidebar')<% } else { %>'t$t('layout.setting.menuTypeMixSidebar')$t$'<% } %>,
    mode: MenuModeEnum.INLINE,
    type: MenuTypeEnum.MIX_SIDEBAR,
  },
];

export const mixSidebarTriggerOptions = [
  {
    value: MixSidebarTriggerEnum.HOVER,
    label: <% if (enableTranslation) { %>t('layout.setting.triggerHover')<% } else { %>'t$t('layout.setting.triggerHover')$t$'<% } %>,
  },
  {
    value: MixSidebarTriggerEnum.CLICK,
    label: <% if (enableTranslation) { %>t('layout.setting.triggerClick')<% } else { %>'t$t('layout.setting.triggerClick')$t$'<% } %>,
  },
];
