<template>
  <div class="flex flex-col h-full w-full overflow-y-auto">
    <p>{{ memberExecutivePositions }}</p>
    <Spinner v-if="loading == 'loading'" class="mx-auto" />
    <p v-else-if="loading == 'failed'">laden fehlgeschlagen</p>
  </div>
</template>

<script setup lang="ts">
import { defineComponent } from "vue";
import { mapActions, mapState } from "pinia";
import Spinner from "@/components/Spinner.vue";
import { useMemberExecutivePositionStore } from "@/stores/admin/memberExecutivePosition";
</script>

<script lang="ts">
export default defineComponent({
  computed: {
    ...mapState(useMemberExecutivePositionStore, ["memberExecutivePositions", "loading"]),
  },
  mounted() {
    this.fetchItem();
  },
  methods: {
    ...mapActions(useMemberExecutivePositionStore, ["fetchMemberExecutivePositionsForMember"]),
    fetchItem() {
      this.fetchMemberExecutivePositionsForMember();
    },
  },
});
</script>
