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

<script setup>
import { onMounted } from 'vue';
import { useAuthStore } from './stores/auth';
import { useWorkspaceStore } from './stores/workspace';

const authStore = useAuthStore();
const workspaceStore = useWorkspaceStore();

onMounted(async () => {
  // Initialize auth first
  await authStore.initialize();

  // If authenticated, initialize workspace
  if (authStore.isAuthenticated) {
    await workspaceStore.initialize();
  }
});
</script>
