<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>
        {{ membership.start }} bis {{ membership.end ?? "heute" }}:
        {{ membership.status }}
      </p>
      <PencilIcon class="w-5 h-5" />
    </div>
    <div v-if="membership.terminationReason" class="p-2">
      <p>Grund: {{ membership.terminationReason }}</p>
    </div>
  </div>
</template>

<script setup lang="ts">
import { defineComponent, type PropType } from "vue";
import { mapState, mapActions } from "pinia";
import type { MembershipViewModel } from "@/viewmodels/admin/membership.models";
import { PencilIcon } from "@heroicons/vue/24/outline";
</script>

<script lang="ts">
export default defineComponent({
  props: {
    membership: {
      type: Object as PropType<MembershipViewModel>,
      default: {},
    },
  },
});
</script>
