<template>
  <AccountMenuContent
    :course-sessions="courseSessionsStore.allCurrentCourseSessions"
    :selected-course-session="courseSessionsStore.currentCourseSession?.id"
    :user="userStore"
    @logout="logout"
    @select-course-session="selectCourseSession"
  />
</template>

<script setup lang="ts">
import AccountMenuContent from "@/components/header/AccountMenuContent.vue";
import { useCourseSessionsStore } from "@/stores/courseSessions";
import { useUserStore } from "@/stores/user";
import type { CourseSession } from "@/types";

const logout = () => {
  userStore.handleLogout();
};
const selectCourseSession = (courseSession: CourseSession) => {
  courseSessionsStore.switchCourseSession(courseSession);
};

const courseSessionsStore = useCourseSessionsStore();
const userStore = useUserStore();
</script>
