<template>
  <h2 class="mb-3 text-2xl font-bold text-center xl:text-3xl enter-x xl:text-left">
    {{ getFormTitle }}
  </h2>
</template>
<script lang="ts" setup>
  import { computed, unref } from 'vue';
<%_ if (enableTranslation) { _%>
  import { useI18n } from '@/hooks/web/useI18n';
<%_ } _%>
  import { LoginStateEnum, useLoginState } from './useLogin';

  // begcode-please-regenerate-this-file 如果您不希望重新生成代码时被覆盖，将please修改为don't ！！！

  <%_ if (enableTranslation) { _%>

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

  const { getLoginState } = useLoginState();

  const getFormTitle = computed(() => {
    const titleObj = {
      [LoginStateEnum.RESET_PASSWORD]: <% if (enableTranslation) { %>t('sys.login.forgetFormTitle')<% } else { %>'t$t('sys.login.forgetFormTitle')$t$'<% } %>,
      [LoginStateEnum.LOGIN]: <% if (enableTranslation) { %>t('sys.login.signInFormTitle')<% } else { %>'t$t('sys.login.signInFormTitle')$t$'<% } %>,
      [LoginStateEnum.REGISTER]: <% if (enableTranslation) { %>t('sys.login.signUpFormTitle')<% } else { %>'t$t('sys.login.signUpFormTitle')$t$'<% } %>,
      [LoginStateEnum.MOBILE]: <% if (enableTranslation) { %>t('sys.login.mobileSignInFormTitle')<% } else { %>'t$t('sys.login.mobileSignInFormTitle')$t$'<% } %>,
      [LoginStateEnum.QR_CODE]: <% if (enableTranslation) { %>t('sys.login.qrSignInFormTitle')<% } else { %>'t$t('sys.login.qrSignInFormTitle')$t$'<% } %>,
    };
    return titleObj[unref(getLoginState)];
  });
</script>
