<template>
  <div class="workbench-summary">
    <div v-for="item in cards" :key="item.key" class="summary-card">
      <div class="summary-card__label">{{ item.label }}</div>
      <div class="summary-card__primary">{{ item.primary }}</div>
      <div class="summary-card__secondary">{{ item.secondary }}</div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'WorkbenchSummary',
  props: {
    cards: {
      type: Array,
      default: () => []
    }
  }
}
</script>

<style lang="scss" scoped>
.workbench-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.summary-card {
  min-height: 96px;
  padding: 12px 14px;
  border: 1px solid #e4e8ef;
  border-radius: 6px;
  background: #fff;
}

.summary-card__label {
  color: #98a2b3;
  font-size: 13px;
}

.summary-card__primary {
  margin-top: 8px;
  color: #2f3542;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.summary-card__secondary {
  margin-top: 8px;
  color: #98a2b3;
  font-size: 13px;
}

@media screen and (max-width: 1200px) {
  .workbench-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 768px) {
  .workbench-summary {
    grid-template-columns: 1fr;
  }
}
</style>
