<template>
  <v-tabs :value="tab" show-arrows>
    <v-tab v-for="tab, index in tabs" :key="index" link :to="tabLink(tab.href)" v-text="tab.text"></v-tab>
  </v-tabs>
</template>

<script>
import { mapActions, mapGetters } from 'vuex';

export default {
  name: 'DougalAppBarExtensionProject',
  data() {
    return {
      tabs: [
        { href: "summary", text: "Summary" },
        { href: "lines", text: "Lines" },
        { href: "plan", text: "Plan" },
        { href: "sequences", text: "Sequences" },
        { href: "calendar", text: "Calendar" },
        { href: "log", text: "Log" },
        { href: "qc", text: "QC" },
        { href: "graphs", text: "Graphs" },
        { href: "map", text: "Map" }
      ]
    };
  },

  computed: {

    page () {
      return this.$route.path.split(/\/+/)[3];
    },

    tab () {
      return this.tabs.findIndex(t => t.href == this.page);
    },

  },

  methods: {

    tabLink (href) {
      return `/projects/${this.$route.params.project}/${href}`;
    }

  }
}
</script>
