<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 { useRouter } from 'vue-router'
import RolesSubPageWrapper from "@/views/dashboards/superUserDashboard/roles/RolesSubPageWrapper.vue";
import RolesPagination from "@/components/displays/pagination/models/SuperUserDashboard/RolesPagination.vue";

</script>

<template>
  <RestrictedPageWrapper :hasPermission="SessionUser.canAccessSuperUser()">
    <RolesSubPageWrapper>
      <template #title>
        <PageTitle title="Roles" subtitle="User roles">
          <template #buttons>
            <button class="button is-dark" @click="SessionUser.objects.roles.showCreateObjectForm()">
              <span class="icon">
                <i class="fas fa-plus"></i>
              </span>
              <span>Tilføj {{ SessionUser.objects.roles.meta.labels.single }}</span>
            </button>
          </template>
        </PageTitle>
      </template>
      <div>
        <RolesPagination auto-load="true" />
      </div>
    </RolesSubPageWrapper>
  </RestrictedPageWrapper>
</template>

<style scoped>

</style>