<template>
  <div class="h-device-card">
    <div class="counts">
      <div class="count">
        <div class="icon"></div>
        <div class="info">
          <div class="num blue">{{ leftCount.value }}</div>
          <div class="label">{{ leftCount.label }}</div>
        </div>
      </div>
      <div class="count">
        <div class="icon"></div>
        <div class="info">
          <div class="num red">{{ rightCount.value }}</div>
          <div class="label">{{ rightCount.label }}</div>
        </div>
      </div>
    </div>
    <div class="content">
      <slot></slot>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    leftCount: {
      type: Object,
      required: true,
      default: () => ({
        img: '',
        value: '',
        label: ''
      })
    },
    rightCount: {
      type: Object,
      required: true,
      default: () => ({
        img: '',
        value: '',
        label: '',
        color: ''
      })
    }
  }
}
</script>

<style lang="less" scoped>
.h-device-card {
  position: relative;
  width: 100%;
  height: 100%;
  .counts {
    padding: 10px 26px 20px;
    display: flex;
    .count {
      flex: 1;
      display: flex;
      align-items: center;
      .icon {
        margin-right: 10px;
        width: 52px;
        height: 52px;
        border: 1px solid red;
      }
      .info {
        color: #fff;
        .num {
          margin-bottom: 6px;
          font-size: 18px;
        }
        .label {
          font-size: 14px;
        }
      }
    }
  }
  .content {
    height: calc(100% - 84px);
  }
}
</style>
