<template>
  <div class="flex flex-col gap-2 h-full w-full overflow-y-auto">
    <Spinner v-if="loading == 'loading'" class="mx-auto" />
    <p v-else-if="loading == 'failed'" @click="fetchProtocolDecision" class="cursor-pointer">
      &#8634; 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 { useProtocolStore } from "@/stores/admin/protocol";
import { QuillEditor } from "@vueup/vue-quill";
import "@vueup/vue-quill/dist/vue-quill.snow.css";
import { toolbarOptions } from "@/helpers/quillConfig";
import { useProtocolDecisionStore } from "../../../../stores/admin/protocolDecision";
</script>

<script lang="ts">
export default defineComponent({
  props: {
    protocolId: String,
  },
  computed: {
    ...mapState(useProtocolDecisionStore, ["decision", "loading"]),
  },
  mounted() {
    this.fetchProtocolDecision();
  },
  methods: {
    ...mapActions(useProtocolDecisionStore, ["fetchProtocolDecision"]),
  },
});
</script>
