<script setup lang="ts">
import { onBeforeMount, ref } from 'vue';
import Login from './components/Login.vue';
import HomePage from './components/HomePage.vue';

const page = ref<number>(0);

onBeforeMount(async () => {
    const loggedIn = await cookieStore.get("loggedIn");
    if (loggedIn?.value == "true") {
        page.value = 1;
    }
})
</script>

<template>
    <Login v-if="page == 0" @next-page="page++"/>
    <HomePage v-if="page == 1" @add-slot="page++"/>
</template>
