<template>
  <router-view />
</template>

<script setup>
import { useAuthStore } from './stores/auth';
import { usePreferencesStore } from './stores/preferences';

import { onMounted } from 'vue';

const authStore = useAuthStore();
const preferencesStore = usePreferencesStore();

onMounted(async() =>
{
  // Check if user is authenticated
  if (!authStore.isAuthenticated)
  {
    authStore.checkAuthStatus();
  }

  // Load user preferences
  await preferencesStore.loadPreferences();
});
</script>
