<script setup>
import { useRouter} from "vue-router";
import { ref } from 'vue';

const router = useRouter();
// Get the user from the route
const departmentId = ref(router.currentRoute.value.params.departmentId)

const tabs = [
  { name: 'Overview', path: '/superuser/statistics' },
  { name: 'Flere statistikker', path: '/superuser/statistics/other' },
];

// Get the current path
const currentPath = ref(router.currentRoute.value.path);

// Get the index of the active tab
const activeTab = tabs.findIndex(tab => tab.path === currentPath.value);

// Change the tab
const changeTab = (index) => {
  router.push(tabs[index].path);
};
</script>

<template>
  <div>
    <div class="tabs is-right">
      <ul>
        <li v-for="(tab, index) in tabs" :key="index" :class="{'is-active': activeTab === index}" @click="changeTab(index)">
          <a>{{ tab.name }}</a>
        </li>
      </ul>
    </div>
  </div>
</template>

<style scoped>
</style>