<template>
  <div v-if="userLoggedIn">
    <button @click="userStore.signOut">로그아웃</button>
    <NuxtLink to="/wadiz/manage">TO manage</NuxtLink>
  </div>
  <div v-else>
    <AdminLogin />
  </div>
</template>
<script setup lang="ts">
import AdminLogin from '~/components/auth/admin-login.vue';

const userStore = useUserStore();
const userLoggedIn = computed(() => userStore.userLoggedIn);

onMounted(() => {
  if (userLoggedIn.value) {
    navigateTo('/');
  }
});
</script>
