<script setup>
import PageTitle from "@/components/global/PageTitle.vue";
import RestrictedPageWrapper from "@/components/page/wrappers/RestrictedPageWrapper.vue";
import { SessionUser } from "@/components/session/token/SessionUser.vue";
import DepartmentSubPageWrapper from "@/views/dashboards/superUserDashboard/department/DepartmentSubPageWrapper.vue";
import { setDepartment, department, departmentId } from "@/views/dashboards/superUserDashboard/department/SuperUserSelectedDepartmentObject.vue";
import { useRouter } from 'vue-router'

// Get the department from the route
const router = useRouter()
setDepartment(router.currentRoute.value.params.departmentId);
</script>

<template>
  <RestrictedPageWrapper :hasPermission="SessionUser.canAccessSuperUser()">
    <DepartmentSubPageWrapper>
      <template #title>
        <PageTitle title="Department" subtitle="Department data" />
      </template>
      <div>
        Department stuff
        <code>{{ departmentId }}</code>
        <code>{{ department.id }}</code>
        <code>{{ department.name }}</code>
        <code>{{ department.description }}</code>
        <code>{{ department.created_at }}</code>
        <code>{{ department.updated_at }}</code>
      </div>
    </DepartmentSubPageWrapper>
  </RestrictedPageWrapper>
</template>

<style scoped>

</style>