<template>
  <div class="card bg-white flex text-center w-full">
    <div class="w-1/4 mt-10" v-for="(item, index) in list" :key="index">
      <div class="text-text-color">{{ item.name }}</div>
      <div
        class="mt-4 text-title-color text-xl font-bold overflow-hidden overflow-ellipsis"
      >
        <span v-if="index < 2">{{ item.value | filterAmount }} YCC</span>
        <span v-else-if="index == 2">
          {{ item.value | filterMoney }} {{ $t('lang.price.dollar') }}
        </span>
        <span v-else>
          {{ item.value }}
        </span>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import Vue, { PropType } from 'vue'
export default Vue.extend({
  props: {
    list: Array as PropType<{ name: string; value: string | number }[]>,
  },
})
</script>

<style scoped>
.card {
  height: 140px;
  border-radius: 4px;
}
</style>
