<script setup>
import { capitalize } from "es-toolkit";

const props = defineProps({
  invoice: Object,
});
</script>

<template>
  <div class="is-flex is-flex-direction-column is-gap-2">
    <div
      class="p-4 rounded-md has-background-primary-95 is-flex is-justify-content-space-between is-align-items-center"
    >
      <div>
        <p class="fs-14 has-text-grey-40">Mã giao hàng</p>
        <p class="is-flex is-gap-1 is-align-items-center">
          <span class="font-semibold">{{ invoice.delivery__tracking_code }}</span>
          <button
            class="button is-ghost is-small size-6 p-0 rounded-full"
            @click="$copyToClipboard(invoice.delivery__tracking_code)"
          >
            <span class="icon">
              <Icon
                name="material-symbols:content-copy-outline-rounded"
                :size="17"
              />
            </span>
          </button>
        </p>
      </div>
      <p class="fs-16 font-medium has-text-primary-50">
        {{ capitalize(invoice.delivery__status) }}
      </p>
    </div>
    <div class="rounded-md has-background-white-bis">
      <div class="p-4">
        <p class="fs-14 has-text-grey-40">Người nhận</p>
        <p class="font-medium">{{ invoice.delivery__receiver_name }}</p>
      </div>
      <hr class="m-0" />
      <div class="p-4">
        <p class="fs-14 has-text-grey-40">Địa chỉ</p>
        <p class="font-medium">{{ invoice.delivery__receiver_phone }}</p>
      </div>
    </div>
  </div>
</template>
