<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';
  import { LoginStateEnum, useLoginState } from './useLogin';
  import locales from '/@/utils/locales';
  const { getLoginState } = useLoginState();

  const getFormTitle = computed(() => {
    const titleObj = {
      [LoginStateEnum.RESET_PASSWORD]: locales.login.forgetFormTitle,
      [LoginStateEnum.LOGIN]: locales.login.signInFormTitle,
      [LoginStateEnum.REGISTER]: locales.login.signUpFormTitle,
      [LoginStateEnum.MOBILE]: locales.login.mobileSignInFormTitle,
      [LoginStateEnum.QR_CODE]: locales.login.qrSignInFormTitle,
    };
    return titleObj[unref(getLoginState)];
  });
</script>
