<script setup lang="ts">
import { computed } from "vue";
import BasicDescriptions from "/@/components/BasicDescriptions";
import { orderRecordColumns } from "/@/utils/details/_purchase";

const props = defineProps<{
  data: Record<string, string>;
  showTicketColumn?: boolean;
  isPurchPay?: boolean;
}>();

const payHiddenColumns = [
  "inv_tag_fee",
  "inv_status",
  "ainv_fee",
  "winv_fee",
  "inv_fee",
  "remark"
];

const columns = computed(() => {
  if (!props.isPurchPay || props.showTicketColumn) return orderRecordColumns;
  return orderRecordColumns.filter(col => !payHiddenColumns.includes(col.field));
});
</script>

<template>
  <BasicDescriptions
    :columns="columns" 
    :data="data" 
  />
</template>
