<script setup>
import { ref } from 'vue'
import { getDepartmentListData } from "@/components/session/Session.vue";
import { showCreateDepartmentForm } from "@/components/forms/superUser/createDepartmentForm.vue";
import PageTitle from "@/components/global/PageTitle.vue";
import DepartmentsPagination from "@/components/displays/pagination/models/SuperUserDashboard/DepartmentsPagination.vue";

const tableData = ref([]);

getDepartmentListData().then((response) => {
  tableData.value = response.data.data;
});

const redirect = (path) => {
  window.location = path;
}
</script>

<template>
  <div>
    <PageTitle title="Afdelinger" subtitle="Her kan du se en liste over alle afdelinger i systemet">
      <template #buttons>
        <button class="button is-dark" @click="showCreateDepartmentForm">
          <span class="icon">
            <i class="fas fa-plus"></i>
          </span>
          <span>Opret ny afdeling</span>
        </button>
      </template>
    </PageTitle>
    <DepartmentsPagination auto-load="true" />
  </div>
</template>

<style scoped>

</style>