<template>
  <div class="flex flex-col h-fit w-full border border-primary rounded-md">
    <div class="bg-primary p-2 text-white flex flex-row justify-between items-center">
      <p>
        {{ damageReport.related.name }}
      </p>
    </div>
    <div class="p-2">
      <p v-if="damageReport.related">Code: {{ damageReport.related.code }}</p>
      <p v-if="damageReport.description">Beschreibung: {{ damageReport.description }}</p>
    </div>
  </div>
</template>

<script setup lang="ts">
import { defineComponent, type PropType } from "vue";
import { mapState, mapActions } from "pinia";
import { useAbilityStore } from "@/stores/ability";
import type { DamageReportViewModel } from "@/viewmodels/admin/unit/damageReport.models";
</script>

<script lang="ts">
export default defineComponent({
  props: {
    damageReport: { type: Object as PropType<DamageReportViewModel>, default: {} },
  },
  computed: {
    ...mapState(useAbilityStore, ["can"]),
  },
});
</script>
