<template>
  <div class="c-perf">
    <div
      v-for="(item, i) in list"
      :key="i"
      class="h-1/4 pt-2.5"
      style="margin-left: 30px;"
    >
      <div class="text-text-color text-xs" style="margin-bottom: 2px;">
        {{ item.name }}
      </div>
      <div class="text-title-color text-sm font-bold">
        {{ 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 lang="scss" scoped>
.c-perf {
  height: 225px;
  background: #ffffff;
  box-shadow: 0px 1px 8px 0px rgba(31, 52, 112, 0.06);
  border-radius: 2px;
}
</style>
