<template>
  <div class="card bg-white flex text-center shadow-shadow1">
    <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"
      >
        {{ item.value }}
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import Vue from 'vue'
export default Vue.extend({
  props: {
    speed: Number,
    tps: Number,
    txNumber: Number,
    addressNumber: Number,
  },
  computed: {
    list(): { name: string; value: string | number }[] {
      return [
        {
          name: this.$t('lang.chainPerf.speed') as string,
          value: this.speed + 's',
        },
        {
          name: this.$t('lang.chainPerf.tps') as string,
          value: this.tps,
        },
        {
          name: this.$t('lang.chainPerf.txNumber') as string,
          value: this.txNumber,
        },
        {
          name: this.$t('lang.chainPerf.addressNumber') as string,
          value: this.addressNumber,
        },
      ]
    },
  },
})
</script>

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