<template>
  <div class="summary19">
    <div class="summary19-item" v-for="(item, index) in data" :key="index" v-if="index < 4">
      <div class="label" v-text="item[keys]"/>
      <span v-text="item[value]"/>
      <p v-if="item.unit" v-text="item.unit"/>
    </div>
  </div>
</template>

<script>
export default {
  name: 'summary19',

  props: {
    data: {
      type: Array,
      default: () => []
    },

    keys: {
      type: String,
      default: 'key'
    },

    value: {
      type: String,
      default: 'value'
    }
  },
}
</script>

<style lang="scss" scoped>
$theme-color: #23ECFD;
.summary19 {
  padding: 22px 14px;
  background: hsla(0, 0%, 100%, .04);
  margin: -16px 16px auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  font-size: 14px;

  div {
    box-sizing: border-box;
  }

  .summary19-item {
    display: flex;
    align-items: baseline;
    gap: 4px;

    span {
      font-family: D-DIN;
      font-size: 22px;
      color: $theme-color;
      min-width: 60px;
      margin-left: 8px;
    }

    p {
      color: $theme-color;
    }

    .label {
      color: white;
      text-align: right;
    }

    &:nth-of-type(2n) {
      justify-self: flex-end;
    }
  }
}
</style>
