<script setup>
import MdrBadge from "@/components/Mudur-Ui-Kit/MdrBadge.vue";
import { computed } from "vue";
const props = defineProps({ invoice: Object });
const status = computed(() => {
  if (!props.invoice.pdf_url) {
    return {
      class: "!text-blue-600 !bg-blue-200",
      text: "PDF Hazırlanıyor",
    };
  } else if (props.invoice.pdf_url && props.invoice.email_sent_at) {
    return {
      class: "!text-green-600 !bg-green-200",
      text: "PDF Hazır, E-posta Gönderildi",
    };
  } else if (props.invoice.pdf_url && !props.invoice.email_sent_at) {
    return {
      class: "!text-red-600 !bg-red-200",
      text: "PDF Hazır, E-posta Gönderilemedi",
    };
  }

  return {
    class: "!text-gray-600 !bg-gray-200",
    text: "PDF Bilinmiyor",
  };
});
</script>
<template>
  <MdrBadge :class="status.class">
    {{ status.text }}
  </MdrBadge>
</template>
