<template lang="pug">
  .w-full.h-full.flex.flex-col
    .flex.w-full.gap-x-2.pb-2
      medical-header(
        v-model="currentMenuItem",
        :change-shown-remove-modal="changeShownRemoveModal",
      )
      medical-records
    component(
      v-if="currentMenuItem",
      v-bind:is="currentMenuItem",
    )
    base-modal(
      v-model="isShownRemoveModal",
      title="Удаление медкарты"
    )
      medical-remove-modal(:change-shown-remove-modal="changeShownRemoveModal")
</template>

<script>
import MedicalHeader from "@/pages/newMedicalCard/components/MedicalHeader.vue";
import MedicalRecords from "@/pages/newMedicalCard/components/MedicalRecords.vue";
import BaseModal from "@/components/base/BaseModal.vue";
import MedicalRemoveModal from "@/pages/newMedicalCard/components/MedicalRemoveModal.vue";
import MedicalBaseInfo from "@/pages/newMedicalCard/components/MedicalBaseInfo.vue";

export default {
  name: "TheCreateMedicalCard",
  components: {
    MedicalRemoveModal,
    BaseModal,
    MedicalRecords,
    MedicalHeader,
    MedicalBaseInfo,
  },
  data() {
    return {
      isShownRemoveModal: false,
      currentMenuItem: "MedicalBaseInfo",
    };
  },
  created() {
    this.$store.dispatch("setMedicalCardData", {
      created_at: new Date(),
      updated_at: new Date(),
      type: "new",
      number: "новая",
      person: {
        last_name: "Введите",
        first_name: "имя",
        patronymic: "пациента",
        priority: 4,
        allergic: [],
      },
    });
  },
};
</script>

<style scoped lang="sass"></style>
