<script setup lang="ts">
import { computed } from 'vue';

const props = defineProps<{
  data?: any;
}>();

const originalAmount = computed(() => {
  return props.data?.refundAmount || 240.00;
});

const finalAmount = computed(() => {
  return props.data?.finalRefundAmount || props.data?.refundAmount || 240.00;
});
</script>

<template>
  <div class="see-amount-container">
    <div class="amount-content">
      <!-- 申请金额展示 -->
      <div class="info-row apply-amount">
        <span class="label">申请金额：</span>
        <span class="symbol">¥</span>
        <span class="value">{{ originalAmount.toFixed(2) }}</span>
      </div>

      <!-- 最终退款金额展示 -->
      <div class="info-row final-amount">
        <span class="label">最终退款金额：</span>
        <span class="symbol">¥</span>
        <span class="value">{{ finalAmount.toFixed(2) }}</span>
      </div>
    </div>
  </div>
</template>

<style scoped lang="scss">
.see-amount-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 20px;
  background: #fff;
  min-height: 240px;
}

.amount-content {
  width: 100%;
  max-width: 400px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;

  .info-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    
    .label {
      font-size: 16px;
      color: #333;
      font-weight: bold;
    }

    .symbol {
      font-size: 18px;
      margin-left: 4px;
      font-weight: bold;
    }

    &.apply-amount {
      .value {
        font-size: 28px;
        font-weight: bold;
        color: #333;
      }
    }

    &.final-amount {
      .symbol {
        color: #ff4d4f;
      }
      .value {
        font-size: 28px;
        font-weight: bold;
        color: #ff4d4f; // 红色文字
      }
    }
  }
}
</style>
