<script setup lang="ts">
import type { OrderAllStatsDto } from '#/api/order';

import { formatCurrency } from '../composables/order-all-page/helpers';

interface Props {
  stats: OrderAllStatsDto;
}

const props = defineProps<Props>();
</script>

<template>
  <div class="oa-stats">
    <span>
      筛选结果<strong>{{ props.stats.totalOrders }} 单</strong>
    </span>
    <span>
      总金额<strong>{{ formatCurrency(props.stats.totalAmount) }}</strong>
    </span>
    <span>
      平均客单价<strong>{{ formatCurrency(props.stats.averageAmount) }}</strong>
    </span>
    <span>
      退款
      <strong class="oa-stats-refund">{{ props.stats.refundCount }} 单</strong>
    </span>
  </div>
</template>
