<template>
  <div class="gamma-card">
    <div class="gamma-title"><span>🏠</span> 逾期勘测V3</div>
    <div class="gamma-grid">
      <div v-for="field in fields" :key="field.key" class="gamma-item">
        <label>{{ field.label }}</label>
        <span>{{ field.display }}</span>
      </div>
    </div>
  </div>
</template>

<script setup>
import { computed } from 'vue';
import { OVERDUE_SURVEY_FIELDS, cellText, overdueResultText } from '../reportHelper';

const props = defineProps({
  data: { type: Object, default: () => ({}) },
});

const fields = computed(() =>
  OVERDUE_SURVEY_FIELDS.map((f) => {
    let display = cellText(props.data[f.key]);
    if (f.key === 'result_code') display = overdueResultText(props.data[f.key]);
    return { ...f, display };
  }),
);
</script>
