<script setup lang="ts">
import LogInCom from "~/components/login/LogInCom.vue";
import SignUpCom from "~/components/login/SignUpCom.vue";
import { useUserStore } from "~/stores";

definePageMeta({
  layout: "login-view"
});

const route = useRoute();
const userStore = useUserStore();
const { isOnline } = storeToRefs(userStore);

const isSignUp = computed(() => route.query._loginAction === "signUp");

watch(isOnline, (online) => {
  if (online) {
    navigateTo("/");
  }
});
</script>

<template>
  <div class="w-full flex justify-center">
    <SignUpCom v-if="isSignUp" />
    <LogInCom v-else />
  </div>
</template>
